Garbage Collection
Automatic memory management that reclaims memory occupied by objects no longer in use by a program.
Also: GC
Definition
Garbage collection (GC) is an automatic memory management feature of some programming languages and runtimes that reclaims memory allocated to objects that are no longer referenced or needed by the program. GC eliminates the need for manual memory management, reducing bugs like memory leaks and dangling pointers. Common GC algorithms include mark-and-sweep, reference counting, and generational garbage collection (used in Java, Go, Python). GC introduces pause times that can affect latency-sensitive applications.
Example
“In Java, when an object is no longer referenced by any variable, the garbage collector automatically reclaims its memory without the developer needing to call free().”
Synonyms
- automatic memory management
- memory reclamation
- GC
Antonyms / Opposites
- manual memory management
- explicit deallocation
Images
CC-licensed · free to useVideo
Related Terms
- memory-management
- java
- reference-counting
- memory-leak
