Memory leak in profiler?



This is a duplicate post from a reply to another thread. I am reposting in order that the subject line addresses the problem, which is different from the one I started with in the first thread, and attracts the interest of people who might be able to help.

Our pipeline is set up to count living and dead neurons using 3 images - a hoechst image for primary nuclei of all cells, a calcein image for secondary object identification (living cells) and a propidium iodide image for primary counting of dead nuclei. We have multiple image sets of 3 images.
Our problem is that the pipeline runs slower and slower as it goes through image sets. If often just hangs after processing 25-40 image sets. When the program does hang, there is a constant stream of messages that go scrolling by in the matlab window, suggesting we’re runnng out of window handles or some other memory issue.
This is a big problem, because we have hundred of images to count, and the ability to work through high numbers of images is one of the attractions of this program.

I think this has to be a memory issue, but whether it’s a memory leak in the pipeline or insufficient memory in the system (we’ve got 512 MB on an 5 yr old Dell system running XP SP2) I don’t know. Using the restart command does enable us to get through our images, but someone needs to sit by the machine to restart the analysis every 20 min, which seems too bad.
I am happy to post the pipleline if anyone thinks the problem is in how it’s set up. Or are there memory management switches to set? Can I flush the memory at the end of each cycle? Any suggestions people have would be very much appreciated.
thanks very much for any ideas or suggestions.


I replied in the other thread. Here’s the quick summary:

1- try turning off display for the modules. This might avoid the memory leak, if it’s in Matlab’s code.

2- Use CreateBatchFiles to split the job into smaller batches that can be run independently, with matlab restarting in between. Let me know if you need more explanation on that process.

3- Please send the pipeline and a couple of example images to