[ImageJ-bugs] [Bug 990] Mac OS out of memory

bugzilla at fiji.sc bugzilla at fiji.sc
Fri Feb 6 12:21:07 CST 2015


http://fiji.sc/bugzilla/show_bug.cgi?id=990

--- Comment #2 from Glen MacDonald <glenmac at uw.edu> ---
Hi Wayne,
First time replying on BugZilla, so hoping this is correct.
Here are macros that [1] generates 4 stacks then [2] opens files, creates a
montage and also prints out memory usage at each step.  I’ve tried with various
stack sizes. Behavior is not entirely consistent on any computer, sometimes all
memory is released when the macro finishes with small stacks. But never with
large stacks.  
When the finished montage does release memory,I was surprised that the memory
for each component stack is not released when that stack is closed, only when
the macro exits.  This means the maximum size of a montage is 1/2 the available
memory.   I ran the debugger bug but saw nothing intelligible to me.  


macro "make stacks [1]"{
    target=getDirectory("Source");
    for (s=0;s<4;s++){
        newImage("HyperStack", "16-bit ramp", 1024, 1024, 3,100,1);
        saveAs("Tiff",target+"Stack000"+s);
    }
}

 macro "make montages [2]"{
     dir=getDirectory("Source");
     dirList=getFileList(dir);
     fList=newArray(0);
     print("Start Macro- Free memory:",IJ.freeMemory(), "Currently in
use:",IJ.currentMemory());
    newImage("Hyperstack", "16-bit composite-mode", 2048,2048,3,100,1);    
    print("Create Stack- Free memory:",IJ.freeMemory(), "Currently in
use:",IJ.currentMemory());
    xx=0;
    yy=0;
    strname="montage";
    grayopt="color_mode=Grayscale view=Hyperstack stack_order=XYCZT";
    for(i=0;i<dirList.length;i++){
        if(endsWith(dirList[i],".tif")||(endsWith(dirList[i],".tiff")))
            fList=Array.concat(fList,dirList[i]);
    }    
        for(f=0;f<fList.length;f++){
            fpath=dir+fList[f];
        //showStatus("Opening stack");
        run("Bio-Formats Windowless Importer", "open=[fpath] [grayopt]");
        rename("Source");
        run("Insert...", "source=Source destination=Hyperstack x=xx y=yy");
        run("Close");
            print("Add Stack "+f+":",IJ.freeMemory(), "Currently in
use:",IJ.currentMemory());
        xx+=1024;
          if (xx==2048) {
             xx = 0;
              yy += 1024;
       }
    }
    run("Close");
    //print("Free memory:",IJ.freeMemory(), "Currently in
use:",IJ.currentMemory());
}



regards

Glen MacDonald
    Core for Communication Research
Virginia Merrill Bloedel Hearing Research Center
    Cellular Morphology Core
Center on Human Development and Disability
Box 357923
University of Washington
Seattle, WA 98195-7923  USA
(206) 616-4156
glenmac at uw.edu







On Jan 21, 2015, at 6:54 PM, bugzilla at fiji.sc wrote:

Wayne Rasband changed bug 990 
What    Removed    Added
CC          wsr at nih.gov

Comment # 1 on bug 990 from Wayne Rasband
Could you provide a small test macro that we can use to reproduce this problem?
The following macro works as expected. The memory used by the four 512x512x100
temporary stacks it opens (25MB each) is reclaimed.

 newImage("Montage", "8-bit ramp", 1024, 1024, 100);
 x=0; y=0
 for (i=0; i<4; i++) {
   newImage("Stack", "8-bit ramp", 512, 512, 100);
   run("Insert...", "source=Stack destination=Montage x=&x y=&y");
   close();
   x += 512;
   if (x==1024) {
      x = 0;
      y += 512;
   }
 }
 setBatchMode(false);


You are receiving this mail because:
    • You are on the CC list for the bug.
    • You reported the bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-bugs/attachments/20150206/c1721135/attachment.html>


More information about the Imagej-bugs mailing list