DynamicLanguages
HeapAndStack
SmartPointer
MemoryLeaks
garbage collection can actually speed up performance by compacting the heap
keep object-count low
- http://www.cs.kent.ac.uk/people/staff/rej/gc.html --umfassende Ressource
- http://www.iecc.com/gclist/GC-faq.html
- Wiki:GarbageCollection
- ReferenceCounting: each object contains a counter saying how many references to it there are. When you refer to an object, you increment the counter. When you're done with it, you decrement the counter. When the counter reaches 0, the object can be recycled.
- MarkAndSweep: starting from the machine registers, stack, and static data regions, do a recursive traversal of all reachable objects and mark them as used. Then go through the heap recycling objects that haven't been marked.
- MarkCompact: All reachable objects are marked, and then compacted into contiguous storage, so all of the free space becomes contiguous.
- StopAndCopy: the heap is divided into two regions. One contains objects, and the other is empty. You recursively traverse all the objects in the first region (as in mark-and-sweep), copying them into the second region. Then you interchange the roles of the two regions. No need to scan the unused objects in the first region.
- HeapCompaction: objects are moved down in memory so that all the free space is consolidated at the end of the heap. This eliminates the problem of memory fragmentation, and speeds up allocation when memory is plentiful, but slows down garbage collection. StopAndCopy? does this automatically when copying from the first heap to the second, but it is possible to compact a single region.
- Wiki:GenerationalGarbageCollection
- TaglessGarbageCollection
- http://www.devx.com/Intel/Article/18160
- http://www.concentric.net/~rtgillam/pubs/Garbage1.html --Einführung
- The Boehm-Demers-Weiser conservative garbage collector
- http://stackoverflow.com/questions/170207/how-to-improve-garbage-collection-performance
- Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
- Overall, generational collectors can add up to 50% space overhead and 5-10% runtime overheads if we ignore virtual memory. Very reasonable given the software engineering benefits.
GC in Python
GC in .Net
GC in Java