# Garbage Collection

Garbage Collection is a form of **automatic memory management**, used by (often) higher-level programming languages to remove the need for complicated manual memory management. As a result, manual memory management is **not implemented**, and the developer relies on the garbage collection to handle memory, preventing bugs such as [UAFs](https://ir0nstone.gitbook.io/notes/binexp/heap/use-after-free) or [Double-Frees](https://ir0nstone.gitbook.io/notes/binexp/heap/double-free).

The two main types are [Tracing Garbage Collection](https://ir0nstone.gitbook.io/notes/binexp/memory-safety/garbage-collection/tracing-garbage-collection) (which is often just referred to as "Garbage Collection") and [Automatic Reference Counting](https://ir0nstone.gitbook.io/notes/binexp/memory-safety/garbage-collection/automatic-reference-counting).
