Recently read the "Garbage Collection Algorithm Handbook" This classic book, take this opportunity to write a few memory management algorithm aspects of the article, but also a summary of it.
--Preface
Automatic Memory Management System
Automatic memory management is mainly faced with the following three tasks:
1. Allocating memory space for new objects
2. Determine the "surviving" object
3. Reclaim the memory space occupied by the "dead" object
Where task 1 is generally referred to as "Automatic memory allocation" (MemoryAllocation, hereinafter referredto as MA), Task 2, 3 is often said "garbage collector" (garbage Collect is GC, hereinafter referred to as GC). In general, in order to reduce the complexity and stability of the automatic memory management system design, the general use of single-threaded design, that is, the MA and GC can not be simultaneous, which explains some managed code in the case of a large number of GC scenarios, because the GC thread is running, the MA thread will wait, That is, managed code pauses execution until the GC ends, and if the GC is running longer, the program will become more noticeable.
Automatic memory management algorithm--tagging method