Repository navigation
Conversation
Memory usage is usage - inactive_file, like docker stats. On cgroup v2 active page cache stays in the figure, so containers that just read large files show memory their processes don't hold. The new per-instance option (default false) subtracts all file cache instead: 'file' on cgroup v2, 'total_cache'/'cache' on cgroup v1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
memory_exclude_file_cacheoptionMemory usage is currently
usage - inactive_file(the same asdocker stats). On cgroup v2 hosts, active page cache stays in the number, so a container that has just read large files shows hundreds of MB that its processes don't hold, and the kernel can reclaim at any time.Example from one host (MB):
anon)This adds a per-instance option, default
false, so existing behaviour is unchanged:When
true, all file cache is subtracted:fileon cgroup v2,total_cache/cacheon cgroup v1. The percentage sensor follows, since it is derived from the same usage value. README and info.md document the option.Tested on Home Assistant 2026.10.4 (Container), Docker on Ubuntu 24.04 (cgroup v2), Monitor Docker 1.20 with this change, ~60 containers, 60 s scan interval.
🤖 Generated with Claude Code