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

Unit Testing
Testing individual components or functions of a program in isolation to verify they work correctly.
Technical Debt
The implied cost of additional rework caused by choosing a quick solution now instead of a better approach that would take longer.
Object-Oriented Programming (OOP)
A programming paradigm that organizes software design around objects containing data and behavior.
Event-Driven Architecture
A software design pattern where components communicate by producing and consuming events rather than direct method calls.
SOLID Principles
Five design principles for writing maintainable, flexible object-oriented code: Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.
Twelve-Factor App
A methodology of twelve best practices for building modern, scalable, maintainable software-as-a-service applications.
View All Programming Concepts Terms โ†’