Skip to content

v1.0.0

Compare
Choose a tag to compare
@raulk raulk released this 20 Jan 12:38
· 8 commits to master since this release
8022773

This release introduces major changes.

Refactors

  • HeapDriven and SystemDriven are now distinct run modes.
  • Policies are now stateless, pure, and simplified. Policies now return a single value: the next utilization at which GC should run. The watchdog honours that target differently depending on the run mode.
  • The HeapDriven watchdog now adjusts GOGC dynamically, based on the policy's target, thus delegating the scheduling of GC to the runtime. This results in a higher reliability, that is not to quick memory bursts within sampling periods.
  • The SystemDriven watchdog remains a polling watchdog.
  • The emergency and silence features of the watermark policy have been removed.

cgroup-driven watchdog

A new cgroup-driven watchdog has been implemented. This watchdog discovers the memory limit from the cgroup of the process (derived from /proc/self/cgroup), or from the root cgroup path if the PID == 1 (which indicates that the process is running in a container). It uses the cgroup stats to obtain the current usage.

automatic heapdump capture

A heapdump will be captured when the usage trespasses a configured threshold. Staying above the threshold won't trigger another heapdump. If the usage goes down, then back up, that is considered another "episode" to be captured in a heapdump. The behaviour is controlled by the Heapdump* global variables.

immune to panics

If a panic occurs in the watchdog, it will be swallowed and the watchdog will be disarmed.