New submission from Kay Hayen <kayha...@gmx.de>:

Hello,

I have created tests that check the reference counting and found that the 
following simple function leaks references in CPython:

def simpleFunction39():
   class Parent( object ):
      pass

I have attached a test that needs to be run with python-dbg and checks the 
total reference count for many language constructs. Sometimes a warmup can be 
useful, if CPython caches something, but it doesn't help in this case. Removing 
object or replacing it with an old style class helps.

I think I saw that 3 references of object leak, and a total of ca. 20 for each 
call to the function. I suspect a memory leak too.

Use the attached file for reproduction of the problem.

----------
components: Interpreter Core
files: Referencing.py
messages: 111433
nosy: kayhayen
priority: normal
severity: normal
status: open
title: Reference leak for local new style class
type: resource usage
versions: Python 2.6
Added file: http://bugs.python.org/file18173/Referencing.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9366>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to