๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

Programming Concepts Intermediate

What is Garbage Collection?

An automatic memory management process that identifies and reclaims memory no longer in use by a program.

Garbage collection (GC) frees developers from manual memory management. The GC periodically identifies objects that are no longer reachable from any reference and reclaims their memory. This prevents memory leaks and dangling pointer bugs.

Common algorithms include reference counting (Python, PHP), mark-and-sweep (JavaScript), and generational collection (Java, .NET). GC introduces some overhead and occasional pauses. Languages like C/C++ and Rust use manual or ownership-based memory management instead.

Related Terms

Composition over Inheritance
A design principle favoring object composition (has-a relationships) over class inheritance (is-a relationships) for code reuse.
Concurrency
The ability of a program to manage multiple tasks that can make progress during overlapping time periods.
Version Control
A system that records changes to files over time, allowing you to recall specific versions, collaborate, and track history.
Regex (Regular Expression)
A sequence of characters that defines a search pattern, used for string matching, validation, and text manipulation.
DRY (Don't Repeat Yourself)
A software development principle that aims to reduce code duplication by abstracting common patterns into reusable components.
Recursion
A programming technique where a function calls itself to solve a problem by breaking it into smaller subproblems.
View All Programming Concepts Terms โ†’