Re: Is ImageJ memory-leaky?
Posted by
Pedro J CamelloDr Pedro J Camello on
Sep 14, 2005; 2:47pm
URL: http://imagej.273.s1.nabble.com/Is-ImageJ-memory-leaky-tp3704878p3704881.html
Many thanks, Albert
regarding your last paragraph
_/If this does not address your problem because your plugin actually uses all
that filled-up memory, try dynamic loading/unloading of memory: release what
you don't need at the moment and then reload it when it is needed. This way I
manage to deal with 6 GB of images at the same time in a 512Mb RAM machine.
/_
could you please explain how to do it /grosso modo? /(I´m afraid in
the next months I´ll need to handle big stacks)
Albert Cardona wrote:
>Pedro,
>
>ImageJ is not leaky that I know of, at all. Memory issues have to do with how
>the java virtual machine works. This is not so different from C/C++: memory
>has to be released at some point or your virtual machine will run out of RAM
>space before it occurs to it to run a garbage collector.
>
>So I recommend you insert code into your plugin that:
>
>1) checks how much memory is available
>2) if not enough for what you want to do, release it by calling in a
>while(true) loop the garbage collector until enough memory has been released.
>3) proceed with whatever memory-consuming task
>
>ImageJ has in the ij.IJ class methods to tests the amount of available memory;
>if you want to do it manually check the java.lang.System class
>
>If this does not address your problem because your plugin actually uses all
>that filled-up memory, try dynamic loading/unloading of memory: release what
>you don't need at the moment and then reload it when it is needed. This way I
>manage to deal with 6 GB of images at the same time in a 512Mb RAM machine.
>
>
>Albert
>
>