← Back to 30-Day Challenge

🔍 Bottleneck Hunting · Days 19–24

Day 20: Garbage Collection Pressure

Objective

Sustain load until GC pauses appear in the infrastructure metrics.

Scenario

Run a heap-heavy workload for 20+ minutes. Watch GC logs or APM metrics. Look for stop-the-world pauses that correlate with response time spikes.

Metrics to Watch

GC pause time / frequencyheap usage

When It Clicks

Periodic latency spikes line up exactly with GC pauses.

Solution

Run a heap-intensive workload for 20+ minutes. Enable GC logging on the JVM: `-Xlog:gc*:file=gc.log:time,uptime:filecount=5,filesize=20m`. Use GCViewer or GCEasy to parse the log post-test. In JMeter's Response Time Graph, GC pauses appear as periodic vertical spikes with fast return to baseline - this is stop-the-world. Sustained GC that never drops back suggests the heap is undersized. Correlate the spike timestamps in gc.log against your JMeter results timestamps to confirm the relationship.

Reflection

Could you see the GC spikes in your tool output before checking the infra metrics?

Deliverable

A script that triggers observable GC pressure.

⚠️ Never run load tests against infrastructure you do not own or have explicit written permission to test. Always use a dedicated test environment. Unauthorized load injection can cause outages, trigger legal liability, and violate terms of service.