Memory leak on python 2.5 if using str(dict(a='a'))

Gabriel Genellina gagsl-py2 at
Tue Apr 28 20:15:08 CEST 2009

En Tue, 28 Apr 2009 05:09:25 -0300, Benjamin Liu <liupingping at>  

> I use guppy-pe to identify this issue in my program. The resources links  
> are all embedded in source code already.

How do you know there is actually a memory leak here?
Can you show the leak without resorting to guppy?
If I understand correctly your example, this program:

def i(**params):
     print params

def test4():
     params = { "a":"a_value", "b":"b_value" }

while True:

should consume unlimited memory - is that what you see?
On Windows, using 2.6.2, after half an hour it still consumes the same  
amount of memory.

(Note that, even if there is a real bug in 2.5, it's too late in the  
development cycle - 2.5 gets only security fixes now)

Gabriel Genellina

More information about the Python-list mailing list