Slaying the Garbage Collection dragon

JVM Garbage collection is a generational collector. This means it splits the heap into multiple generations, which it calls Eden, Survivor and Old. By broad strokes, it works like this: New allocations are made in Eden. When eden fills up, a young GC cycle kicks in and copies any still living objects to the survivor …