<html>
    <head>
      <base href="http://fiji.sc/bugzilla/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEEDSINFO "
   title="NEEDSINFO - memory leak with python script"
   href="http://fiji.sc/bugzilla/show_bug.cgi?id=1203#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEEDSINFO "
   title="NEEDSINFO - memory leak with python script"
   href="http://fiji.sc/bugzilla/show_bug.cgi?id=1203">bug 1203</a>
              from <span class="vcard"><a class="email" href="mailto:aryeh@cc.huji.ac.il" title="Aryeh Weiss <aryeh@cc.huji.ac.il>"> <span class="fn">Aryeh Weiss</span></a>
</span></b>
        <pre>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...</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>