Is that a memory leak ?

Michael Hudson mwh at
Fri Jan 24 19:03:50 CET 2003

"vonstroheim" <vonstroheim at> writes:

> I am using a windows debug 2.2.2 version and I observe the following
> behavior in the interactive interpreter:
> if I repeatedly enter:
> class A(object):pass
> the number of REFS raises and so does the value returned by
> len(gc.get_objects())
> (even if I use gc.collect())
> but if i use a 'classic class' : 'class A: pass', no increasing is noticed.
> Is that OK or is it a memory leak ?

Err, I think Py_DEBUG implies COUNT_ALLOCS implies new-style classes
are immortal.  So nothing (particularly) untoward here.  If you see
problems in a release build, do shout.


  Need to Know is usually an interesting UK digest of things that
  happened last week or might happen next week. [...] This week,
  nothing happened, and we don't care.
                           -- NTK Now, 2000-12-29,

More information about the Python-list mailing list