[ImageJ-bugs] [Bug 1203] memory leak with python script

bugzilla at fiji.sc bugzilla at fiji.sc
Wed Dec 9 01:26:11 CST 2015


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

--- Comment #5 from Aryeh Weiss <aryeh at cc.huji.ac.il> ---
There is something about getProcessor()
In my script I had two getProcessor() calls which I could remove

resultDupIp = resultDupImp.getProcessor() # (at about line 250)
and 
maskIp = maskImp.getProcessor()  # (at about line 313)

Removing these called reduced the amount of "stuck" memory from
5.8GB to about 2.9GB

I have two there places that I use the Ip

inputIp = inputImp.getProcessor()
inputImp.setTitle(inputPrefix+"_mono")
monoTitle = inputImp.getTitle()

rf = RankFilters()
rf.rank(inputIp, 1, RankFilters.MEDIAN)


I tried replacing this with: 
IJ.run(inputImp, "Median...", "radius=1");
or even 
IJ.run(inputImp, "Mean...", "radius=1"); 

but this did not change anything. Apparently, the call using the static
method also gets an Ip.

Same thing with:

bgIp = bgImp.getProcessor()
radius = 100.0
accuracy = 0.01
GaussianBlur().blurGaussian( bgIp, radius, radius, accuracy)

which I tried to replace with either
IJ.run(bgImp, "Gaussian Blur...", "sigma="+str(radius));

or 

IJ.run(bgImp, "Mean...", "radius="+str(radius));   # really slow...


but again, no change.

So getProcessor() apparently creates this hard reference...

-- 
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/20151209/7beea730/attachment.html>


More information about the Imagej-bugs mailing list