help with memory leak

Chris Angelico rosuav at gmail.com
Tue May 27 16:50:36 EDT 2014


On Wed, May 28, 2014 at 5:56 AM, Neal Becker <ndbecker2 at gmail.com> wrote:
> I'm trying to track down a memory leak in a fairly large code.  It uses a lot of
> numpy, and a bit of c++-wrapped code.  I don't yet know if the leak is purely
> python or is caused by the c++ modules.

Something to try, which would separate the two types of leak: Run your
program in a separate namespace of some sort (eg a function), make
sure all your globals have been cleaned up, run a gc collection, and
then see if you still have a whole lot more junk around. If that
cleans everything up, it's some sort of refloop; if it doesn't, it's
either a global you didn't find, or a C-level refleak.

ChrisA



More information about the Python-list mailing list