[issue20519] uuid.uuid4().hex generates garbage when ctypes available

2014-02-05 Thread Gustavo J. A. M. Carneiro
New submission from Gustavo J. A. M. Carneiro: If you try the attached program, you will find that for every iteration the uuid.uuid4() call generates objects that contain reference cycles and need the help of the garbage collector. This is not nice. If I make the ctypes module not able to

[issue20519] uuid.uuid4().hex generates garbage when ctypes available

2014-02-05 Thread R. David Murray
R. David Murray added the comment: I'm not sure that this is a real problem, but have you identified what the cycle is? -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20519

[issue20519] uuid.uuid4().hex generates garbage when ctypes available

2014-02-05 Thread Gustavo J. A. M. Carneiro
Gustavo J. A. M. Carneiro added the comment: Well, this isn't a big problem, but I have an application that needs to run with the GC disabled, since it causes pauses of a couple of seconds each time a full collection runs (we have a few million objects allocated). I will run the GC only once

[issue20519] uuid.uuid4().hex generates garbage when ctypes available

2014-02-05 Thread Gustavo J. A. M. Carneiro
Gustavo J. A. M. Carneiro added the comment: I have narrowed it down to one line of code: ctypes.create_string_buffer(16) That is enough to create 7 objects that have reference cycles. [class 'ctypes.c_char_Array_16', {'__module__': 'ctypes', '__doc__': None, '__weakref__': attribute