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

Memory leak - linked to GUI ? #134

Open
NicoKiaru opened this issue Nov 6, 2021 · 9 comments
Open

Memory leak - linked to GUI ? #134

NicoKiaru opened this issue Nov 6, 2021 · 9 comments

Comments

@NicoKiaru
Copy link
Contributor

Hi @bogovicj ,

I noticed that after using BigWarp and closing it programmatically with bigWarp.closeAll() I have some memory not released.

The eclipse memory analyzer shows this suspect trace:

image

I tested and got the same issue with a 'regular' Fiji and BigWarp:

  • start Fiji
  • double click on the ImageJ window to triggger GC, you should see around 50 MB occupied
  • open two images, in my test around 50 MB each -> trigger GC, you have around 150 MB (at this point, closing the images and triggering GC brings back the memory to 50 MB, as expected)
  • then run BigWarp with these two images and put a few landmarks
  • close BigWarp
  • close the Images in ImageJ
  • trigger GC -> 150 MB are still occupied, the images are still in memory

There is at least one reference to the images kept via a LandmarkKeyboardProcessor:

image

@bogovicj
Copy link
Contributor

@NicoKiaru

Thanks for reporting and for all those details. I'll investigate

@bogovicj
Copy link
Contributor

@NicoKiaru ,
Just a long overdue update. I was able to replicate this easily thanks to the instructions you gave. I spent some time last week tracking this down. So far I haven't been able to solve this despite finding (what I thought) were some promising leads... I'll keep trying.

@NicoKiaru
Copy link
Contributor Author

Couldn't it be a thread which is not stopped ? What is the solvethread and what is it doing ?

@bogovicj
Copy link
Contributor

@NicoKiaru
Hmm, good idea I'll try.
That thread is what re-solves for the transformation in the background in response to landmark changes.

@NicoKiaru
Copy link
Contributor Author

@bogovicj any news on this bug ? It's not critical (one can close Fiji once in a while) but it would be nice to have it fixed.

@NicoKiaru
Copy link
Contributor Author

Hi there,

Any news on this by any chance ? Is there a chance this could be solved in v9 (I'm still stuck to v8) ?

It's keeping a huge about of memory since ini the end it keeps track of the image. It looks like the SolveThread is never closed when BigWarp is closed.

image

(I'll try to spend some time on my other issues, but it'll be hard within the next week)

image

@NicoKiaru
Copy link
Contributor Author

Is this thread stopped somewhere ?

solverThread.start();

bogovicj added a commit that referenced this issue Apr 4, 2024
* seems to address the worst offenders
* some of this cleanup is likely overkill

see #134
@bogovicj
Copy link
Contributor

bogovicj commented Apr 4, 2024

@NicoKiaru

I think / hope that the worst of this leak is fixed here https://github.com/saalfeldlab/bigwarp/tree/memoryLeak
Will stress test a little more next week, but the behavior seems much better when I do the steps you outlined above.

@NicoKiaru
Copy link
Contributor Author

Hi @bogovicj , I see that the memory leak fix are not in the master branch - do you plan to merge them ?

Cheers

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

No branches or pull requests

2 participants