Chapter 3. Garbage Collection
When writing applications, managing the available memory is boring and difficult. When the application gets complex, it's easy to start leaking memory. Many programming languages have automatic memory management, helping the developer to forget about this management by means of a Garbage Collector (GC). The GC is only a part of this memory management, but it's the most important one and is responsible for reclaiming memory that is no longer in use (garbage), by periodically looking at disposed referenced objects and freeing the memory associated with them.
The most common technique used by GC is monitoring reference counting. This means that GC, for each object, holds the number (count) of other objects that reference ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access