Differences between revisions 3 and 4
Revision 3 as of 2008-02-10 21:54:36
Size: 1202
Editor: www-gw4
Comment:
Revision 4 as of 2008-02-11 11:06:22
Size: 1198
Editor: PaulBoddie
Comment: Slight tidying.
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
As Christian Heimes describes it [http://groups.google.com/group/comp.lang.python/browse_thread/thread/32e62acc62773a3d#d9baaa3a229ad90b here], Python uses its own memory allocator for small objecst (< 257 bytes). Larger objects are allocated directly with malloc, smaller objects end up in arenas. The code is well documented [http://svn.python.org/view/python/trunk/Objects/obmalloc.c?rev=56476&view=auto in obmalloc.c]. As Christian Heimes describes it [http://groups.google.com/group/comp.lang.python/browse_thread/thread/32e62acc62773a3d#d9baaa3a229ad90b here], Python uses its own memory allocator for small objects (< 257 bytes). Larger objects are allocated directly with malloc, smaller objects end up in arenas. The code is well documented [http://svn.python.org/view/python/trunk/Objects/obmalloc.c?rev=56476&view=auto in obmalloc.c].
Line 3: Line 3:
 * Classes with a __del__ method may create reference
cycles. The GC can't break cycles when a __del__ method is involved.
 * keeping references to tracebacks, exception objects (except
Exception, err) or frames (sys._getframe())
 * Classes with a __del__ method may create reference cycles. The GC can't break cycles when a __del__ method is involved.
 * keeping references to tracebacks, exception objects (except Exception, err) or frames (sys._getframe())

As Christian Heimes describes it [http://groups.google.com/group/comp.lang.python/browse_thread/thread/32e62acc62773a3d#d9baaa3a229ad90b here], Python uses its own memory allocator for small objects (< 257 bytes). Larger objects are allocated directly with malloc, smaller objects end up in arenas. The code is well documented [http://svn.python.org/view/python/trunk/Objects/obmalloc.c?rev=56476&view=auto in obmalloc.c].

  • Classes with a del method may create reference cycles. The GC can't break cycles when a del method is involved.

  • keeping references to tracebacks, exception objects (except Exception, err) or frames (sys._getframe())

Related information:

FreeMemory (last edited 2010-11-27 04:19:23 by adsl-074-166-103-084)

Unable to edit the page? See the FrontPage for instructions.