saalfeldlab / bigwarp

A tool for manual pointwise deformable registration using bigdataviewer.
GNU General Public License v2.0
27 stars 14 forks source link

Memory leak - linked to GUI ? #134

Open NicoKiaru opened 3 years ago

NicoKiaru commented 3 years ago

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:

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

image

bogovicj commented 2 years ago

@NicoKiaru

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

bogovicj commented 2 years ago

@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 commented 2 years ago

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

bogovicj commented 2 years ago

@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 commented 1 year ago

@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 commented 8 months ago

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 commented 8 months ago

Is this thread stopped somewhere ?

https://github.com/saalfeldlab/bigwarp/blob/a418ad3fd69398968a6cda9da4d5d9f1a0d5d26a/src/main/java/bigwarp/BigWarp.java#L542

bogovicj commented 7 months ago

@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 commented 3 months ago

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

Cheers