Re: [micro-manager-general] Clearing RAM issue
Status: Beta
Brought to you by:
nicost
|
From: Chris W. <cwe...@ms...> - 2014-08-20 17:06:09
|
On Wed, Aug 20, 2014 at 9:56 AM, Shawn Cho <gra...@gm...> wrote: > Hmm, I do have a custom plug-in I'm using written in Java. I'm not sure > what references I would free - doesn't garbage collection take care of this? > Garbage collection will (eventually) delete any objects that are not referred to by any other extant objects. Such "orphaned" objects cannot be accessed anyway, which is why they're safe to delete. However, if there's an "active" object A that has a reference to an object B, then B will never be garbage collected; A has to remove its reference first. > Here's a bit of my code where I save my imagestack: > > ============= start code =============== > > > > ImagePlus imp = IJ.getImage(); > > IJ.run(imp, "AVI... ", "compression=Uncompressed frame=" + fps + " > save=["+ vidName + ".avi]"); > > imp.close(); > I don't claim to know how ImagePlus objects work, but to be safe, you could do something like "imp = null" after doing "imp.close()" so that your plugin's reference to the ImagePlus is removed. Though if "imp" is purely a local variable within a function, then it will de-scope at the end of the function (automatically removing the reference to the ImagePlus), so such steps are unnecessary. > > My main problem is the FPS is being reduced after my first video > acquisition. Any idea what would cause this besides RAM? I was monitoring > the RAM usage and it was steadily increasing with each video acquisition > without clearing. > Unless you actually run out of physical RAM, total RAM utilization should not have any impact on the speed at which acquisitions run. I'd be more inclined to suspect that something has changed in your acquisition or camera settings after the first acquisition. You may want to compare the Device/Property Browser values from before and after the acquisition to look for differences. -Chris |