Garbage collection only reclaims memory from objects that are no longer referenced. It does not prevent out-of-memory errors - if your program creates objects faster than GC can reclaim them, or holds onto too many live objects, it will still run out of memory. GC manages memory but doesn't guarantee unlimited availability.