Re: memory problem

Posted by Michael Schmid on
URL: http://imagej.273.s1.nabble.com/New-plugin-auto-threshold-tp3692969p3692973.html

Hi Lucia,

some possible reasons for a memory leak:

Do you use a BatchMode macro that creates new images in BatchMode  
(thus invisible), but never closes them? Quit Batchmode with  
setbatchMode("exit and display") to check this.

Are there any threads that don't terminate? See  
Plugins>Utilities>Threads. You should typically see something like  
the following:

Thread Group: system  Max Priority: 10
     Thread: Reference Handler  Priority: 10 Daemon
     Thread: Finalizer  Priority: 8 Daemon
     Thread: Signal Dispatcher  Priority: 9 Daemon
     Thread: Java2D Disposer  Priority: 10 Daemon
     Thread Group: main  Max Priority: 10
         Thread: AWT-AppKit  Priority: 5 Daemon
         Thread: AWT-Shutdown  Priority: 5
         Thread: AWT-EventQueue-0  Priority: 6
         Thread: SocketListener  Priority: 5
         Thread: DestroyJavaVM  Priority: 5
         Thread: Threads...  Priority: 4

You can also use Process>Utilities>Monitor Memory for further  
analysis. The display will include unused (but available) memory.  
Thus Click the status line (below the icons of the ImageJ panel)  
twice to start GarbageCollection, i.e., to free unused memory.

Hope this helps,

Michael
________________________________________________________________

On 13 Apr 2009, at 13:09, Laura Lucia Prieto Godino wrote:

> Hi list,
>
> I have a problem and I really can't find the way of solving it.  
> Since 4 days ago, when I use the colour couting it wont do the  
> operation and will say that the available memory ha been used, so  
> what i do is to increase the memory allowance for image j, restart  
> it and keep using it, but now it has reached the limit again  
> (766MB) and this means that there must be something wrong because  
> every time I open 6 stacks at a time, do a few things with them,  
> extract some info and  then I close them all, and open a 6 new  
> ones, so as I close everytime the  old stacks, and as I open always  
> the same number of stacks the memory should not run out, but it  
> does, which means that somehow image j is keeping in the memory the  
> old stacks that i have opened, but I dont need that, i just need  
> image j to remeber what i am doing with the stacks that are open,  
> once i close them i am done with them! How can I solve this  
> problem, for the moment I can keep expanding the memory allowance  
> of image j but that is obviously a short term solution.
>
> Thank you very much,
>
> best,
>
> lucia
>
>
>  Lucia Prieto Godino
> PhD student.
> Department of Zoology,
> Downing street
> University of Cambridge.
> UK