<html>
<head>
<base href="http://fiji.sc/bugzilla/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Mac OS out of memory"
href="http://fiji.sc/bugzilla/show_bug.cgi?id=990#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Mac OS out of memory"
href="http://fiji.sc/bugzilla/show_bug.cgi?id=990">bug 990</a>
from <span class="vcard"><a class="email" href="mailto:glenmac@uw.edu" title="Glen MacDonald <glenmac@uw.edu>"> <span class="fn">Glen MacDonald</span></a>
</span></b>
<pre>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
<a href="mailto:glenmac@uw.edu">glenmac@uw.edu</a>
On Jan 21, 2015, at 6:54 PM, <a href="mailto:bugzilla@fiji.sc">bugzilla@fiji.sc</a> wrote:
Wayne Rasband changed <a class="bz_bug_link
bz_status_NEW "
title="NEW - Mac OS out of memory"
href="show_bug.cgi?id=990">bug 990</a>
What Removed Added
CC <a href="mailto:wsr@nih.gov">wsr@nih.gov</a>
<a href="show_bug.cgi?id=990#c1">Comment # 1</a> on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Mac OS out of memory"
href="show_bug.cgi?id=990">bug 990</a> 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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>