Hi,
On Wed, 6 May 2009, Guanghua Du wrote:
> I am developing a plugin in ImageJ, when I run this Plugin, the memory
> goes to very high (~GB). I have used gabage collection in the java code
> (even repeat several times), I still cannot resolve this problem. The
> memory use keeps high even the plugin finishes. What interesting is when
> I right click on the memory monitor window of ImageJ, the memory goes to
> low immediately, within several clicks, it goes to normal level (several
> MB). (I have set a memory of 1.4GB for ImageJ.)
>
> when I do 3D analyzing on a small stack-image (8bit,50x50x35), it can
> run to the end successfully. if it's a big image(8bit, 255x255x35), then
> I got the exception: " java.lang.OutOfMemoryError: Java heap space"
It very much depends on the exact algorithm you are using.
Often, you can avoid running out of memory by releasing arrays early, or
by reserving arrays of a less-precise data type (e.g. byte instead of
int).
I fear that I cannot help you more without actually having a look at the
source code.
Ciao,
Dscho