Make sure you have no references left to the images no longer needed and
run a garbage collection (System.gc()) before loading the next image.
You can watch the memory usage with the Memory Monitor
(Plugins>Utilities>Monitor Memory)
Volker
chepe santacruz wrote:
> Hello fellow developers,
>
> Scenario:
>
> I have written an ImageJ plugin that analysez a selected directory
> that contains only images.
> the program: - opens 1 image
> - analyzes it
> - closes the image
> - opens the next image if any and repeats process
> untill all images are analyzed.
>
>
> Problem:
>
> The program works fine for 1 image, 2 images...and so on but if there
> are 5 or more images the program freezes.
>
> I suspect that i am running out of memory when i analyze > 4 images
> even though I am using the ImagePlus.hide() method to close the window
> but i don't think that it is enough. Is there some command i can use
> to something i should do to free memory for an image i no longer need?
>
> thank you,
> Bill
>
--
passerelle antivirus du campus CNRS de Montpellier
--