SOAK TEST · MEMORY GROWTH
Agent soak test: expose a slow memory leak
Run a modeled load test for hours, sample the heap, fit a growth rate and see whether a slow leak is exposed or missed.
Event trace
Computed data
Final metrics
Modeled process, not a load generator or JVM. The heap starts at 400 MB, a cache fills 200 MB linearly during the first hour after each start, and each request retains the configured kilobytes forever. Garbage collection, fragmentation, allocation spikes and sampling noise are not modeled; heap is sampled once per hour and the growth rate is an ordinary least-squares slope.
Why the opening run misses the leak
The modeled agent takes 10 requests per second and retains 2 KB per request, a true leak of 70.3 MB per hour. With Test duration at 1 h the run collects two hourly heap samples: 400 MB at hour 0 and 670.3 MB at hour 1. Exclude the first (warm-up) hour from the trend is on, so only one sample is usable and no growth rate can be fitted. The verdict is LEAK MISSED, although the ground truth says a 2,048 MB heap would be exhausted at hour 20.6.
Run long enough to see a trend
Set Test duration to 2 h. Three hourly samples are taken, and the two after warm-up give a least-squares slope of 70.3 MB/h, above the Growth alarm at 20 MB/h: LEAK EXPOSED. At 24 h the slope is the same and the process runs out of memory at hour 20.6 after 21 samples. Raise Request rate to 20 req/s and the leak doubles to 140.6 MB/h, with out-of-memory at hour 10.3. A Heap limit of 4,096 MB over 48 h survives all 49 samples, yet the slope still exposes the leak, with exhaustion projected at hour 49.7.
Warm-up growth is not a leak
Set Memory retained per request to 0 and clear the warm-up option. At 1 h the cache fill alone fits 200 MB/h, and at 2 h it fits 100 MB/h: both are FALSE ALARM. At 24 h the warm-up hour dilutes to 1.8 MB/h, and excluding it gives 0 MB/h: CLEAN. Including warm-up can also mislead the other way: with the 2 KB leak at 2 h the fit reads 170.3 MB/h, more than double the true rate.
Small leaks and scheduled restarts
At 24 h, a leak of 0.5 KB per request grows 17.6 MB/h, under the 20 MB/h alarm: LEAK MISSED, although exhaustion is projected at hour 82.4. Lower Growth alarm above to 15 MB/h and it is exposed; 0 turns the alarm off. Now restore 2 KB and set Scheduled restart every 6 h: each sample at a restart hour starts again at 400 MB, the slope is -1.1 MB/h and the leak is missed. Restarts hide a leak; they do not fix it.
Controls, transport and limits
Play runs the sixty inspection seconds and becomes Pause; Next event jumps to the next sample; Restart returns to zero; Speed runs at 0.25× to 2×; Inspection time seeks directly. The verdict and metrics appear only at 60 s, while the Complete-run preview states it at once. Heap starts at 400 MB and a 200 MB cache fills during the first hour after each start. Garbage collection, fragmentation, allocation spikes and sampling noise are not modeled, so a real soak test also needs heap dumps to find what is retained.