JARVIS-MoCap / JARVIS-AnnotationTool

AnnotationTool to create multi-view annotations for the JARVIS 3D Markerless Pose Estimation Toolbox
https://jarvis-mocap.github.io/jarvis-docs/
GNU Lesser General Public License v2.1
24 stars 6 forks source link

Memory leak on Annotation #13

Closed timsainb closed 1 year ago

timsainb commented 2 years ago

This is on a machine with 32GB ram on ubuntu 20.04 with a dataset with 1000 frames and 5 cameras.

With each frame annotated, my ran slowly fills up. After annotating less than 20 frames, the program crashes with full RAM.

This is the full readout:

$ AnnotationTool 
2022-09-27T16:21:50: [W] Initializing RHI with OpenGL backend (unknown - unknown:0)
Killed
JARVIS-MoCap commented 2 years ago

Since you're getting the line 2022-09-27T16:21:50: [W] Initializing RHI with OpenGL backend (unknown - unknown:0) in the output I'm assuming you opened the 3D viewer window right?

During testing I noticed that opening and then closing the 3D viewer window causes the RAM to steadily fill up until the process is killed just as you describe it. Just to confirm this is indeed the only issue, does the memory leak also happen when you do not close the 3D viewer window?

Thanks for your help, Timo

JARVIS-MoCap commented 2 years ago

Small update: I updated the Ubuntu 20.04 version of the AnnotationTool in the 1.2 release with a version that fixed the RAM buildup issue on my computer. Please let me know if this does not solve the problem on your side!

timsainb commented 2 years ago

Thanks Timo,

I just tested your hypothesis that it is the 3D viewer and I can confirm that it is. I then updated to the new release (I confirmed that this is in the gui dabd4701-dirty) but the memory leak continues (again, not until after I open the 3D viewer).

JARVIS-MoCap commented 2 years ago

Thanks for trying it out! Does the memory leak happen as soon as you open the 3D viewer or only after closing it? And does the memory fill up only when you add annotations or gradually over time?

timsainb commented 2 years ago

I only noticed it after I closed it and it fills gradually even if I don’t annotate

JARVIS-MoCap commented 2 years ago

I just tested the installer that I uploaded on the Releases page on two different Ubuntu 20.04 machines and did not see any memory leaks over time. That being said the change that fixed the issue for me was to clear the Qt3D canvas before closing the window. I am not sure why this helps and what causes the memory leak in the first place. Digging into it a bit I found some references on the QT forums that reference similar issues (like this). One entry I can't seem to find anymore also mentioned issue on specific CPU graphics architectures. I'm 90% sure this is some unexpected behavior in Qt3D itself, so I will probably have to give up on troubleshooting this for now. As far as I understand it this is not a critical issue for you, since you can avoid it by not closing the 3D viewer window, right?

timsainb commented 2 years ago

Yeah, this isn’t a critical issue I can still label my data, and there’s no reason to use the 3D tool when I’m doing so.