[issue15635] memory leak with generators

Antoine Pitrou report at bugs.python.org
Mon Aug 13 18:39:32 CEST 2012


Antoine Pitrou added the comment:

> > All of this clearly points towards malloc not releasing allocated memory to the system.
> > This is perfectly fine and not a bug in either Python or the system.
> 
> So it means there's no reliable way to measure the memory consumption of the program.

What it means is that "memory consumption" itself is a bit ill-defined.
"ps", "top" and friends will tell you the amount of memory (physical or
virtual) currently assigned by the OS to the process. It doesn't tell
you whether the memory is "actually" in use by the program.

Note that, in Python 3.3, sys._debugmallocstats() gives you
fined-grained information about the object allocator. This excludes any
blocks bigger than 512 bytes, though, since those are requested directly
using malloc() and free().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15635>
_______________________________________


More information about the Python-bugs-list mailing list