Re: Flush/clear memory in ImageJ/Fiji
Posted by
Unruh, Jay-2 on
URL: http://imagej.273.s1.nabble.com/Flush-clear-memory-in-ImageJ-Fiji-tp3682491p3682493.html
So does the typical FIJI launcher disable the java garbage collector? In regular ImageJ I am typically successful in clearing out memory with the garbage collector. Buying more RAM doesn't improve things if you are running 32-bit windows. Of course, perhaps I should buy a 64-bit machine, but I find it hard to require all of my users to buy such machines or come to a central facility to process their images (In that case, many of them may opt out of ImageJ anyway).
On a side note, I have experienced memory leaks/inefficient memory freeing with a recent version of LOCI even with using the garbage collector. These are especially problematic when opening leica files which require large amounts of RAM to browse, but not necessarily to load. One of my users could only open a few images before having to crash and restart ImageJ. I rolled back to the second most recent version and that seemed to fix things.
Jay
-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of Albert Cardona
Sent: Wednesday, October 19, 2011 11:44 AM
To:
[hidden email]
Subject: Re: Flush/clear memory in ImageJ/Fiji
2011/10/19 mjlm <
[hidden email]>:
> Hi there,
> Is there a way (e.g. a macro command) to clear out unused, but still
> allocated memory in ImageJ (I'm using Fiji under Win7 64bit)? When I
> open a large file and then close it, the memory used for that large
> file is sometimes not cleared. When I then try to open another large
> file, I get a warning of insufficient memory.
>
> I've tried to trigger Java garbage collection with
> call("java.lang.System.gc"), but it didn't have any effect. My problem
> usually occurs when opening large files using the LOCI tools.
Matthias,
launch the JVM with different flags. Fine-tuning the JVM is an art all by itself. Here are the parameters that worked for me, along with some
explanations:
http://fiji.sc/wiki/index.php/TrakEM2#Running_fiji_for_heavy-duty.2C_memory-intensive.2C_high-performance_TrakEM2_tasksOf course, the cheapest of all solutions is to buy more RAM.
Albert
--
http://albert.rierol.nethttp://www.ini.uzh.ch/~acardona/