Java / Java 17 Garbage Collection Interview Questions
What is a major GC?
"Major GC" is used, somewhat loosely, to describe a collection that reclaims the old generation. Its exact meaning depends on the collector: for Parallel or Serial GC it's a distinct stop-the-world old-gen collection; for G1 there's no single "major GC" event as such - instead, a concurrent marking cycle identifies garbage-heavy old regions, which are then reclaimed incrementally through a series of mixed collections that also sweep in some young regions.
Because old-gen collections touch a much larger, higher-occupancy portion of the heap than a minor GC, they take noticeably longer and happen far less often - usually only after the old generation has accumulated enough promoted objects to cross a threshold like G1's InitiatingHeapOccupancyPercent (IHOP).
More Related questions...