[issue3063] memory leak in random number generation

Tim Peters report at bugs.python.org
Sun Jun 8 18:18:27 CEST 2008


Tim Peters <tim.peters at gmail.com> added the comment:

Strongly doubt this has anything to do with random number generation. 
Python maintains a freelist for float objects, which is both unbounded
and immortal.  Instead of doing "data[i] = random()", do, e.g., "data[i]
= float(s)", and I bet you'll see the same behavior.  That is, whenever
you create a number of distinct float objects simultaneously alive, the
space they occupy is never released (although it is available to be
reused for other float objects).  The use of random() here simply
creates a large number of distinct float objects simultaneously alive.

----------
nosy: +tim_one

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


More information about the Python-bugs-list mailing list