python - occur memory leak when import uuid -


i found memory leak when import uuid.

python 2.7.1 (r271:86832, nov 27 2010, 18:30:46) [msc v.1500 32 bit (intel)] on win32 type "help", "copyright", "credits" or "license" more information. >>> import gc >>> gc.set_debug(gc.debug_leak) >>> gc.collect() 0 >>> gc.garbage [] >>> import uuid >>> gc.collect() gc: collectable <tuple 026a2d30> gc: collectable <_ctypes.pycsimpletype 026dc190> gc: collectable <getset_descriptor 026a4fa8> gc: collectable <getset_descriptor 026a4fd0> gc: collectable <tuple 026a5600> gc: collectable <stgdict 026a61e0> gc: collectable <tuple 026a84b0> gc: collectable <stgdict 026aa7c8> gc: collectable <_ctypes.pycarraytype 026fad30> gc: collectable <getset_descriptor 026ad148> gc: collectable <getset_descriptor 026ad170> gc: collectable <tuple 026ac150> gc: collectable <tuple 0269ba50> gc: collectable <stgdict 026aa978> gc: collectable <_ctypes.pycfuncptrtype 026fb4d0> gc: collectable <getset_descriptor 02699d50> gc: collectable <getset_descriptor 02699e18> gc: collectable <tuple 0269d180> gc: collectable <tuple 0269bbf0> gc: collectable <stgdict 026aaa50> gc: collectable <_ctypes.pycfuncptrtype 026fb6b8> gc: collectable <getset_descriptor 026ad5d0> gc: collectable <getset_descriptor 026ad5f8> gc: collectable <tuple 0269d540> 25 **>>> gc.garbage** [(<type '_ctypes._simplecdata'>,), <class 'ctypes.c_longdouble'>, <attribute '__dict__' of 'c_longdouble' objects>, <attribute '__weakref__' of 'c_longdouble' objects> ypes.c_longdouble'>, <type '_ctypes._simplecdata'>, <type '_ctypes._cdata'>, <type 'object'>), {'__dict__': <attribute '__dict__' of 'c_longdouble' objects>, '_type_': le__': 'ctypes', '__weakref__': <attribute '__weakref__' of 'c_longdouble' objects>, '__doc__': none}, (<type '_ctypes.array'>,), {'__module__': 'ctypes._endian', '__d ibute '__dict__' of 'c_long_array_3' objects>, '__weakref__': <attribute '__weakref__' of 'c_long_array_3' objects>, '_length_': 3, '_type_': <class 'ctypes.c_long'>, ne}, <class 'ctypes._endian.c_long_array_3'>, <attribute '__dict__' of 'c_long_array_3' objects>, <attribute '__weakref__' of 'c_long_array_3' objects>, (<class 'ctype ong_array_3'>, <type '_ctypes.array'>, <type '_ctypes._cdata'>, <type 'object'>), (<type '_ctypes.pycfuncptr'>,), {'__module__': 'ctypes', '__dict__': <attribute '__di ncptr' objects>, '__weakref__': <attribute '__weakref__' of '_funcptr' objects>, '_flags_': 1, '__doc__': none, '_restype_': <class 'ctypes.c_long'>}, <class 'ctypes._ ttribute '__dict__' of '_funcptr' objects>, <attribute '__weakref__' of '_funcptr' objects>, (<class 'ctypes._funcptr'>, <type '_ctypes.pycfuncptr'>, <type '_ctypes._c  'object'>), (<type '_ctypes.pycfuncptr'>,), {'__module__': 'ctypes', '__dict__': <attribute '__dict__' of '_funcptr' objects>, '__weakref__': <attribute '__weakref__' ' objects>, '_flags_': 1, '__doc__': none, '_restype_': <class 'ctypes.c_long'>}, <class 'ctypes._funcptr'>, <attribute '__dict__' of '_funcptr' objects>, <attribute ' of '_funcptr' objects>, (<class 'ctypes._funcptr'>, <type '_ctypes.pycfuncptr'>, <type '_ctypes._cdata'>, <type 'object'>)] **>>> len(gc.garbage)** 24 >>> 

after search related resource, found same issue import ctypes. found issue @ http://bugs.python.org/issue12142.

i wonder whether bug should report bugs.python.org.

not leak. setting gc.debug_leak causes garbage collector append collectable objects garbage list instead of freeing them. can see collector found freeable, since messages collectable.


Comments