Skip to content

0x334 Runtime

1. Garbage Collection

Interestingly, according to Wikipedia, Garbage collection was invented by John McCarthy around 1959 to simplify manual memory management in Lisp.

1.1. Tracing

This is the most common approach.

It is tracing which objects are reachable by a chain of references from certain "root" objects, and considering the rest as "garbage" and collecting them.

1.2. Reference Count

Another common approach

2. Reference

[1] Fundamentals of garbage collection in CLR