In a plugin we are currently developing to analyze our experiments, we are browsing through stacks of images, displaying / analyzing one stack after another. To do so, I have implemented a list of sequences as a JComboBox, allowing users to go from one stack to the other, and/or to analyze either single stacks or a whole range of stacks.
Behind the scene, the stack images are loaded into a sequence according to the procedure described in an earlier message on this discussion (“Loading images / creating sequence is SLOW”), which basically feeds into a sequence the first image of the stack and then add all images one by one in a separate thread, making them virtual.
This works well for a few stacks that do not contain to much images, but with 24 stacks of 240 images, I a quickly using up to 8 Gb memory. Each time a new stack is selected, the memory use goes up and does not return back, or I see saw-like patterns in the memory use. More, when I close the stacks but leave my plugin open, the memory takes ages to be liberated and during a while, I see activity that looks related to the cache. And it takes 1 or 2 GC (double clicking on the lower right window of Icy) to get the memory use down.
I suppose that the cache is still having the numerous files declared and continues to feed in and out the corresponding files.
Is there a way to freeze the cache and clean it from the files previously fed into it that I know not being needed anymore?
Thank you in advance for any help,