
Java Garbage Collection Explained From Generations Up
How the JVM finds and frees unreachable objects, why most collectors are generational, how G1 and ZGC differ and what pause and throughput really mean.
Garbage collectors, heap sizing, JIT behaviour and reading a flame graph when the JVM is the suspect.

How the JVM finds and frees unreachable objects, why most collectors are generational, how G1 and ZGC differ and what pause and throughput really mean.

Fix the JVM start-up error about reserving heap space by checking 32-bit JVMs, a heap larger than memory, container limits and fragmented address space.

Read large JDBC result sets without running out of memory: setFetchSize, streaming cursors in PostgreSQL and MySQL, and transaction needs.

Fix java.lang.OutOfMemoryError Java heap space by deciding whether the heap is too small or something is leaking, using a heap dump to tell the two apart.

Decide between volatile, synchronized and atomic classes for shared state, with the counter example that shows why volatile alone is not enough.

Use SpringBootTest without slow suites: share contexts, avoid DirtiesContext, trim the context, use slices and share containers.

Compare the G1, ZGC, Shenandoah, Parallel and Serial collectors on pauses, throughput and footprint, and pick one with a test on your own workload.

Understand autoboxing in Java: primitives versus wrappers, the Integer cache, NullPointerException on unboxing, equality traps and memory cost.

Write a timing aspect for Spring that flags slow methods: a custom annotation, threshold logging, Micrometer timers and the limits of proxy timing.

Use ExecutorService correctly: choose a pool type, submit Runnable and Callable, handle Future results and exceptions, bound the queue and shut down cleanly.

Turn on unified GC logging, read a G1 log line field by field and recognize the patterns for leaks, undersized heaps, long pauses and allocation spikes.

Use jcmd, jstack and jmap on a live Java process without causing an outage: which commands pause the JVM, how to attach in containers and what to capture.
We send one email when a new post is published. No spam.