Login  Register

Re: Out of Memory Problems

Posted by Rasband, Wayne (NIH/NIMH) [E] on Jul 26, 2013; 2:43pm
URL: http://imagej.273.s1.nabble.com/Out-of-Memory-Problems-tp5004033p5004155.html

On Jul 26, 2013, at 7:59 AM, Gabriel Landini wrote:

> On Friday 26 Jul 2013 05:22:31 Rasband, Wayne  [E] wrote:
>> With ImageJ 1.48a and earlier, the memory is not reclaimed when you
>> click in the "Memory" window.
>
> Is this code supposed to work if pasted all in a macro window (it does not
> here) or does it have to be split into 2 macros?

You have to first install it using the Macros>Install Macros command, which creates a Plugins>Macros>Open Image command.

>>  doCommand("Monitor Memory...");
>>  setBatchMode(true);
>>  for(i=0;i<100;i++) {
>>     run("Open Image");
>>     wait(20);
>>  }
>>  run("Close All");
>>  exit;
>>
>>  macro "Open Image" {
>>     newImage("Untitled", "8-bit ramp", 1024, 1024, 1);
>>  }
>>
>
> If I replace run("Open Image"); with the line newImage(... etc
> (i.e. avoid having 2 macros) the memory consumption increases and it is never
> released by the garbage collector.  IJ1.48b1  Java 1.6.0_35 (64bit linux).
> Sorry if I misunderstood

I am unable to reproduce this problem with either v1.48a or v1.48b1 using Java 1.6.0_24 and 32-bit Linux. Did you try forcing the garbage collector to run by clicking in the "Memory" window?

-wayne
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html