Cage opened this issue on Dec 20, 2006 ยท 1232 posts
adp001 posted Thu, 11 January 2007 at 9:21 PM
Dont't know exactly, but perhaps the following may be a hint regarding your memory problem:
*Warning: Keeping references to frame objects, as found in the first element of the frame records these functions return, can cause your program to create reference cycles. Once a reference cycle has been created, the lifespan of all objects which can be accessed from the objects which form the cycle can become much longer even if Python's optional cycle detector is enabled. If such cycles must be created, it is important to ensure they are explicitly broken to avoid the delayed destruction of objects and increased memory consumption which occurs.*Though the cycle detector will catch these, destruction of the frames (and local variables) can be made deterministic by removing the cycle in a finallygc.disable(). For example: clause. This is also important if the cycle detector was disabled when Python was compiled or using
<em>def handle_stackframe_without_leak():<br></br> frame = inspect.currentframe()<br></br> try:<br></br> # do something with the frame<br></br> finally:<br></br> del frame</em><br></br>
Every time a function is called, a "frame" is build for tracebacks and such.
It is possible that CP's programmers changed how garbage collection works, because memoryleaks are not a common problem with Python > 2.
You can find the original documentation here (Python 2.4).
Documentation for 2.2 does not contain this information (just change the version number in the URL to 2.2, 2.3).