I noticed that when I’m using CellProfiler (v.9978) (on Windows 7 32-bit) to examine a batch of images, the RAM usage quickly climbs to nearly a gigabyte and I start getting MemoryErrors. So I started to look into it, and it appears there is a memory leak in one of the modules.
I have a pipeline that performs multiple image manipulations, IdentifyPrimaryObjects, and EditObjectsManually for one or more images with all “visible” flags set to false.
CellProfiler starts up at ~75 MB. If I run my pipeline on one 1024x1024x12-bit image, without displaying anything, I’m left with 120 MB. If I display an image, 125 MB when the image is closed and multiple runs don’t accumulate memory. If I display an IdentifyPrimaryObjects module, it’s 165 MB when the result image is closed, which also doesn’t seem to accumulate between runs.
However, if I display EditObjectsManually, even without removing any objects, once the run ends I’m left with 250 MB when I close the EditObjectsManually result window. If I run the pipeline again on the same image, 372 MB when the result window is closed. A third time, 495 MB. So every time the EditObjectsManually window is displayed, ~125 MB is consumed and never released, and is thus the source of my MemoryError issues. ConserveMemory doesn’t help, of course, since that is geared toward releasing images purposely maintained outside of the module.
I don’t really know enough about Python to contribute to fixing the bug; my programing experience is limited to Visual Basic .Net. However, I very much need this module to work for my analysis and as I’m typically analyzing ~70 images for a single experiment, I don’t have a spare 10 GB of RAM lying around that might allow me to use it (assuming CellProfiler could even access that much RAM), so if someone might be able to point me in the right direction I could at least take a look.