Java / Java 17 Garbage Collection Interview Questions
What is a minor GC?
A minor GC is a collection that runs against the young generation only - it scans Eden and the active survivor space, copies still-reachable objects into the other survivor space (or promotes them to old gen if they're old enough), and reclaims everything else.
It's triggered whenever Eden fills up and a thread can't allocate a new object into its Thread-Local Allocation Buffer (TLAB). Because the young generation is small relative to the whole heap and most objects there are already dead, minor GCs are usually fast, often single-digit milliseconds, even though most collectors still pause application threads (stop-the-world) while running one.
Minor GCs happen far more frequently than old-generation or full collections in a typical application.
More Related questions...