Apex › Systems & OS

How garbage collection works

In a managed language you never call free() — so the runtime finds the dead objects itself. A narrated walk through tracing mark-and-sweep: start from the roots, mark everything reachable, free the rest, and see why this collects reference cycles that simple reference counting would leak forever. Drop a reference and run the collector on a live object graph.

More in Systems & OS