Class JvmMemoryPressure

java.lang.Object
com.kingsrook.qqq.backend.core.health.JvmMemoryPressure

public final class JvmMemoryPressure extends Object
Tracks whether this JVM is under sustained memory pressure: the heap still full after garbage collection, or the JVM spending a large share of wall time in GC pauses. A JVM in that state answers every request slowly for minutes before it throws OutOfMemoryError, so probes use it to take the pod out of the load balancer (readiness) and, if it lasts, restart it (liveness). Readings are taken when a probe or the health runner asks (kubelet probes every few seconds); nothing runs in the background. Each reading compares against the oldest sample still inside the window: - heap after GC is the lowest after-GC occupancy seen in the window, so one full collection that frees the heap clears the condition; - GC time is the pause time added across the window divided by its length. Pressure starts when either crosses its threshold and ends only when the latest heap after GC is below the recovery percent and GC time is below its threshold, so a JVM near the line does not flap.