Repository navigation
v0.9.19
Memory-leak fix. Constat kept a ring-buffer + aggregated-history + averages entry for every container name it ever saw, forever — including transient one-shots (docker run without --name → auto-generated names like admiring_hofstadter). On systems that ran many one-shots over time, 60%+ of in-memory stats was phantoms.
Fixed
- Phantom-container accumulation in stats history. Three cleanup mechanisms added:
- Docker
destroyevent handler — when a container is fully removed (explicitdocker rmor--rmauto-cleanup), the event stream now callsStatsCollector.RemoveContainer(name)to purge the entry fromhistory,aggregated,averages,latest,meta,status,prevNet,streams, and reverse-mapidToName. Previouslydestroywas silently ignored. - Startup prune — 30 s after boot,
StatsCollector.PruneStaleruns one pass againstdocker ps -aand removes any tracked name Docker no longer knows about. Flushes accumulated backlog from prior versions. - Hourly safety-net scan — same
PruneStaleruns every hour to catch destroys the event stream might have missed (reconnect gaps, daemon restarts).
- Docker
- History is keyed by container name, not ID — stats for real containers survive Unraid Force Update / image upgrades / ID changes intact. The cleanup only removes names Docker itself has forgotten about.
Notes
- No config knobs. Keeping stats for removed containers was a bug, not a feature.
- Logs
StatsCleanup: pruned N stale container(s) from stats historyon every non-zero prune. - Expect a one-time RAM drop on first boot after upgrade if you had accumulated phantoms. Steady state thereafter.
Full changelog: https://github.com/ProphetSe7en/constat/blob/main/CHANGELOG.md