Overview

The Performance Silent Killer

Understanding GC is vital for Non-Functional Testing. If a system's memory management is poorly tuned, it can lead to massive latency spikes under load.

When performing Soak Testing (running a system under load for long periods), QAs monitor the memory 'sawtooth' pattern created by Garbage Collection to ensure there are no memory leaks.

Our Recommendation
7/ 10
Recommendation for score 7

Best Practices

Dos and Don'ts

Avoid common mistakes that can lead to flaky tests and maintenance nightmares.


What to do

  • Monitor GC metrics during performance tests using tools like JVisualVM or New Relic.
  • Watch for 'Memory Leaks' where the baseline memory consumption keeps rising despite GC runs.

Common Pitfalls

  • Don't assume 'Automatic Memory Management' means 'No Memory Problems'.
  • Don't ignore high CPU usage that might be caused by a 'thrashing' Garbage Collector.

The Details

Analyzing the Memory Sawtooth

In a healthy system, memory usage should look like a sawtooth pattern: it rises as objects are created, then drops sharply as the Garbage Collector clears them. If the 'valleys' of the sawtooth are getting higher over time, you have identified a potential memory leak that will eventually crash the system in production.