2012年11月4日 星期日

garbage collection in pyhton

key words


Mark and sweep (classic mark-and-sweep implementation)


Semispace copying
(two-arena garbage collection, copying of alive objects into the other arena
happens when the active arena is full)




Generational GC (implemented as a
subclass of the Semispace copying GC, this one adds two-generation garbage
collection to distinguish between short-lived and long-living objects)

Hy-
brid GC (adding another generation to handle large objects), Mark &
Compact GC (with in-place compaction to save space, but using multiple
passes) and the Minimark GC (a combination of the previous methods,
rewritten and with a custom allocator).



Refs:
http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)
http://fcamel-life.blogspot.tw/2011/12/cpython-garbage-collection.html
http://blog.ez2learn.com/2010/04/22/memory-efficient-python-with-bytearray/
http://blogs.msdn.com/b/abhinaba/archive/2009/01/25/back-to-basic-series-on-dynamic-memory-management.aspx

沒有留言:

張貼留言