AI engineering glossary · Computing foundations

What is garbage collection?

Garbage collection: Automatic memory management in which a language runtime finds objects a program can no longer reach and frees their memory. It spares programmers from releasing memory by hand, at the cost of some overhead and occasional pauses.

Level: intermediateTopic: Computing foundations

Garbage collection: an example

When you overwrite the only variable pointing to a large list in Python, its memory is soon reclaimed automatically.

Related terms

More Computing foundations terms

Where you learn it

Garbage collection is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.