Posted by
ctrueden on
Dec 08, 2008; 7:29pm
URL: http://imagej.273.s1.nabble.com/huge-memory-leaks-in-Vista-64-with-LOCI-Bioformats-tp3694295p3694297.html
Hi John,
This problem was mentioned a few months ago, too:
http://n2.nabble.com/Java-memory-not-release-when-image-stacks-closed-td637015.htmlSo it is not specific to Bio-Formats. It is not specific to ImageJ either,
but actually a property of Java itself.
For example, here is a thread on Experts Exchange describing someone who had
this problem with Tomcat server:
http://www.experts-exchange.com/Web/Application_Servers/Q_20899033.htmlAnd someone replied in one of the answers: "THe JVM does not release
memorythe OS allocated to it - it handles its own
memory and the assumption is that getting memory from the OS is time
consuming, so it won't release it based on the GC behavior (this would
dramatically decrease performance)."
However, I am not sure whether this statement is accurate -- there seems to
be a lot of misinformation about Java memory behavior online, and it is hard
to filter out the bogus information.
I wrote a tiny Java application for testing, and the behavior does seem to
depend on the operating system:
On Mac OS X 10.4, the "Real" memory entry for a Java application never
decreases, despite the resources being freed from within Java and garbage
collected.
On Windows XP, the "Mem Usage" column in Task Manager does decrease when
memory is freed. There is also some weirdness with minimized applications
reportedly consuming far fewer resources -- maybe a bug in XP's Task
Manager, or maybe some property of Windows XP's memory management.
On Ubuntu Linux 10.4, the Memory column in System Monitor decreases properly
when memory is freed.
I do not have a Windows Vista machine on hand to test, but if you are
feeling adventurous you can try yourself using my program:
https://skyking.microscopy.wisc.edu/svn/java/trunk/utils/TestMem.javaAnyone else know more about this phenomenon?
-Curtis
On Mon, Dec 8, 2008 at 12:12 PM, John Alexander <
[hidden email]>wrote:
> Hi,
>
> I'm running the latest ImageJ with the latest LOCI Bioformats - and I've
> noticed huge memory leaks.
>
> If I open up a GB of images (slidebook format, imported with the LOCI
> Bio-formats reader), process some, then close most, imageJ will report
> only 100 MB of memory usage, but the Windows Task Manager reports the
> JAVA machine is using over 2 GB!
>
> I'm not totally sure this is related to the LOCI Bioformats plugin
> either. I believe that if I open a lot of TIFF images, process them,
> then close most of them, the JAVA Machine again reports high memory
> usage even though ImageJ reports very little.
>
> Can somebody assist me in figuring out how to rectify this? The problem
> is that after a bit of image processing, my machine begins to bog down
> due to increased memory swapping
>
>
> John
>