Releases: raulk/go-watchdog
Release 1.3.0
- Switch the clock library back to upstream (https://github.com/benbjohnson/clock).
- Correctly restore GOGC to the original value.
v1.2.0
- introduce the possibility of receiving a callback before forced GC runs; this gives the application the opportunity to shed resources to be collected on imminent GC.
- introduce the possibility of customizing the funciton that runs on forced GC; this enables the application to more aggressively return memory to the OS by setting it to debug.FreeOSMemory.
Thanks to @marten-seemann for the contributions!
v1.1.0
go-watchdog now supports multiple GC notifees. The global NotifyGC
variable is deprecated, and has been replaced with a RegisterNotifee
function. NotifyGC
is still invoked if non-nil, but it will be removed entirely in future releases.
Thanks to @marten-seemann for this feature.
v1.0.1
v1.0.0
This release introduces major changes.
Refactors
HeapDriven
andSystemDriven
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.