tuples allocated by formated print ?

Alexander Hoffmann alexander.hoffmann at netgenius.de
Wed Sep 8 18:54:25 CEST 2004


On Wednesday 08 September 2004 18:34, keirr wrote:
> Alexander Hoffmann wrote:
> > Hello,
> >
> > Recently I was debugging a memory leak in my app and finally figured
>
> out that
>
> > I had to manually implement destructors for some classes.
> > While debugging I wrote a method that prints the number of instances
>
> per type
>
> > for all objects returned by gc.get_objects. I was astonished by the
>
> fact that
>
> > after perfroming a few tests with my app there were about 4000
>
> instances of
>
> > Tuple in memory. Looking at these instances I got the feeling that
>
> they
>
> > contained the values I used in formated prints like: print ("my name
>
> is %s" %
>
> > ("alex", ))
>
> <snip>
>
> Do these objects survive gc.collect() ?

yes, forgot to mention that I checked the instances after calling gc.collect 
()

Alex



More information about the Python-list mailing list