[SCIFIO] SCIFIO does not seem to release memory of closed images
Burkhard Höckendorf
burkhard.hoeckendorf at web.de
Sat Jul 12 13:54:47 CDT 2014
Dear List,
First of all thanks for developing scifio and doing that open source. I
have started to use it with ImageJ, since Fiji now offers the option to
use it. Having said that, I may also have stumbled upon an issue. I'm
unsure when (or whether) scifio releases the corresponding memory after
images are closed. To look at this in a somewhat systematic way, I ran a
macro (see below) to repeatedly open and close a 3GB single file
uncompressed TIFF stack (2048x2048x367x16bits) and record some
performance stats along the way. I ran this using a new download of Fiji.
Here are the results with scifio disabled:
11450 ms to open files
28578184 mem before opening files
9282667288 mem after opening files
9272732560 mem after opening files & GC
9272780080 mem after closing files
24220936 mem after closing files & GC
And here with scifio enabled:
43715 ms to open files
26765224 mem before opening files
10517954400 mem after opening files
9327459480 mem after opening files & GC
9327506440 mem after closing files
9314822896 mem after closing files & GC
I have also checked, whether memory is freed a couple of minutes after
closing the images, which does not appear to be the case.
Note that scifio is also somewhat slower, although I'm a bit hesitant to
bring this up, because it is still relatively young and I can see a few
"improve ... performance" tickets in the issue tracker.
Below is the macro.
Kind regards,
Burkhard
nOpenTimes = 3;
file = "/path/to/stack";
run("Collect Garbage");
memBefore = IJ.currentMemory();
msToOpen = getTime();
for (i=0; i<nOpenTimes; i+=1) {
open(file);
}
msToOpen = getTime() - msToOpen;
memFilesOpen = IJ.currentMemory();
run("Collect Garbage");
memFilesOpenGC = IJ.currentMemory();
for (i=0; i<nOpenTimes; i+=1) {
close();
}
memFilesClosed = IJ.currentMemory();
run("Collect Garbage");
memFilesClosedGC = IJ.currentMemory();
print(""+ msToOpen + " ms to open files");
print(""+ memBefore + " mem before opening files");
print(""+ memFilesOpen + " mem after opening files");
print(""+ memFilesOpenGC + " mem after opening files & GC");
print(""+ memFilesClosed + " mem after closing files");
print(""+ memFilesClosedGC + " mem after closing files & GC");
More information about the SCIFIO
mailing list