๐ŸŽ 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

Design Pattern
A reusable solution template for commonly occurring problems in software design.
Observer Pattern
A design pattern where an object (subject) maintains a list of dependents (observers) that are notified automatically of state changes.
Singleton Pattern
A design pattern that restricts a class to a single instance and provides a global point of access to that instance.
Debugging
The process of finding and fixing errors (bugs) in software code to ensure correct program behavior.
Thread
The smallest unit of execution within a process, allowing concurrent operations to run within a single program.
API Design
The practice of designing application programming interfaces that are consistent, intuitive, and maintainable for developers to consume.
View All Programming Concepts Terms โ†’