Java / Java 17 Garbage Collection Interview Questions
What is the Eden space?
Eden is the sub-region of the young generation where nearly all new objects are first allocated, typically via a per-thread Thread-Local Allocation Buffer (TLAB) so most allocations avoid any locking or contention with other threads.
Because most objects die quickly, Eden fills up rapidly and is the most frequently collected part of the heap - once it's full, a minor GC runs, copying anything still reachable out into a survivor space and leaving Eden completely empty for reuse afterward.
More Related questions...