Erlang's garbage collector (GC) is based on Cheney's algorithm, which pioneered the idea of semispace copying collection and avoids recursion and fragmentation.
In Erlang, each lightweight process runs on the BEAM VM and is fully isolated with no shared memory, allowing the GC to only affect the process whose heap is full and avoiding global pauses.
Copying is safe and predictable in Erlang as it uses immutability, and during the process, a forwarding pointer is left behind to avoid multiple copies of the same object and ensure proper reference updates.
Erlang's GC is generational and promotes objects that survive multiple GCs to the old generation, reducing allocation pressure and collection frequency for stable processes.