]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
This no longer leaks memory when run in an infinite loop. However,
authorTim Peters <tim.peters@gmail.com>
Wed, 27 Jun 2001 07:17:57 +0000 (07:17 +0000)
committerTim Peters <tim.peters@gmail.com>
Wed, 27 Jun 2001 07:17:57 +0000 (07:17 +0000)
commitf6ed0740a89bea8a8b219c3dbce0702e25e18bd8
tree5c53a12f02e9cfb8f02300c9572785d6fcbacd6b
parentce9b5a55e164f1128756478b6a2bb548abec1980
This no longer leaks memory when run in an infinite loop.  However,
that required explicitly calling LazyList.clear() in the two tests that
use LazyList (I added a LazyList Fibonacci generator too).

A real bitch:  the extremely inefficient first version of the 2-3-5 test
*looked* like a slow leak on Win98SE, but it wasn't "really":  it generated
so many results that the heap grew over 4Mb (tons of frames!  the number
of frames grows exponentially in that test).  Then Win98SE malloc() starts
fragmenting address space allocating more and more heaps, and the visible
memory use grew very slowly while the disk was thrashing like mad.
Printing fewer results (i.e., keeping the heap burden under 4Mb) made
that illusion vanish.

Looks like there's no hope for plugging the LazyList leaks automatically
short of adding frameobjects and genobjects to gc.  OTOH, they're very
easy to break by hand, and they're the only *kind* of plausibly realistic
leaks I've been able to provoke.

Dilemma.
Lib/test/test_generators.py