Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrackMate does not free up RAM when closing. #185

Open
tinevez opened this issue Jul 27, 2021 · 9 comments
Open

TrackMate does not free up RAM when closing. #185

tinevez opened this issue Jul 27, 2021 · 9 comments
Assignees
Labels

Comments

@tinevez
Copy link
Member

tinevez commented Jul 27, 2021

If I track a 250MB image (one coming from the ISBI SPT challenge, VIRUS snr 7 density high) I see it at the end of the tracking. I document here quickly the RAM usage followed with the Monitor Memory tool (it is not relevant to check RAM usage from the Windows tool).
Every value I report are the one reported by the tool after garbage collection.
I used the devel version of TrackMate for the test.

  • Opening Fiji
    43 MB

  • Opening the Image
    295 MB

  • Launching TrackMate
    480 MB

  • In the config panel of the LoG detector, after preview
    310 MB (sigh)

  • If I close TrackMate UI and the image now, the RAM usage goes down to 58 MB, which is what we expect.

  • After full detection (diameter 5, threshold 50, no initial thresholding, I got about 100k spots), in the spot filter panel
    530 MB

  • If I close TrackMate now, it does NOT give back the RAM. I still use 530 MB

So here is my memory leak.

@tinevez tinevez added the bug label Jul 27, 2021
@tinevez tinevez self-assigned this Jul 27, 2021
@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/trackmate-does-not-free-up-ram-when-closing/54922/4

@NicoKiaru
Copy link

@tinevez I'm curious to know how you deal with this. Visualvm + eclipse MAT?

@tinevez
Copy link
Member Author

tinevez commented Jul 27, 2021

I am actually using the YourKit Java profiler, making a RAM snapshot.

@tinevez
Copy link
Member Author

tinevez commented Jul 27, 2021

Hum I am afraid I am failing big time on this one.
I cannot manage to identify the culprit with my method.
Still trying.

@ctrueden
Copy link
Member

@tinevez Just a guess: is it possible that some JFrame or JDialog objects are not being disposed when closed? I see you have some setDefaultCloseOperation( WindowConstants.DISPOSE_ON_CLOSE ); calls, but there are quite a few different new JFrame and extends JFrame invocations in TrackMate, most of which are not set to dispose on close.

I pushed a branch dispose-on-close where I tried to set the default close operation to dispose for all frames I could quickly find. But I don't have time to test it now, sorry. Maybe you could try it and see if the memory leak persists?

Do you have any frames that you allow the user to toggle visibility by closing them temporarily? Like, they can press the X, but then another button elsewhere can show the frame again? If so, we'd need to do something more clever to dispose such frames at the proper time later.

@NicoKiaru
Copy link

I've got this:

image

A lambda in FilterGuiPanel

@NicoKiaru
Copy link

Maybe linked to a thread which is not stopped:
image

@NicoKiaru
Copy link

When butchering out the OnRequestUpdater thread and the PainterThread in WizardPanel I get this chain:

image

@NicoKiaru
Copy link

Add after removing the ImagePlus keys in displayers of SpotEditTool:

image

Not sure this is going to end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants