Glossary

Garbage Collection

Garbage collection (GC) is automatic freeing of memory from objects that are no longer in use. Instead of manual memory management (malloc/free in C), the runtime tracks and cleans up unreachable objects automatically.

Algorithms

PHP and GC

PHP uses reference counting + a cyclic garbage collector. Circular references (A → B → A) are not freed by reference counting — the cyclic GC handles them. gc_collect_cycles() triggers it manually.

Performance impact

GC pauses can affect latency. Go's GC is concurrent — pauses under 1 ms. Older JVM GC pauses were measured in seconds.