System page: MEM% considers entire host RAM, ignoring Docker mem limit #5004
Replies: 3 comments 2 replies
-
The problem is I don't know if this would help with OOM, the biggest issues with memory usage is usually downloading MP4 clips which are stored in memory, but this wouldn't show up in the current system page or as sort of any process that shows in top. If this will continue to work as is but also support your use case then sure makes sense. But you'd need to consider the amount of time this would take, we don't want the delay to be too much when trying to view the system stats. |
Beta Was this translation helpful? Give feedback.
-
It would make it a lot more transparent if you were in danger though. I thought my memory usage was pretty good at around 20% total because that's what the System page told me, right up until it crashed as it was really 99%. The MP4 point is interesting though, I will monitor the container during playback and see what happens. In terms of delays - the |
Beta Was this translation helpful? Give feedback.
-
PR #5011 raised. Actually ended up being slightly simpler in the end. |
Beta Was this translation helpful? Give feedback.
-
I tend to limit the maximum memory available to my docker containers, to stop a rogue container locking up the host. I'm experimenting with the memory allocated to the Frigate container. I have a VM with 12GB allocated, which runs multiple Docker containers. Frigate was assigned 1GB memory, and recently I spotted it OOM'ing. This surprised me given all the MEM% figures were < 3% on the System page. One problem is that the detector process doesn't show mem usage which I propose to change. The other is down to the use of
top
to get the percentages. By default,top
is not aware of any Docker-enforced limit, so it calculates MEM% as if the entire host memory is available.After a bit of testing, it seems you can do:
...to get the max memory assigned to the container in bytes. I've tested and this path is still available even if no memory limits are set in the container - it just containers "max" instead of a number of bytes.
I am proposing to send a PR to do:
free -b
/sys/fs/cgroup/memory.max
top
memory figure by total (should match existing % figure)top
memory figure by total (should match existing % figure)top
process memory into total host memoryInterested in any thoughts or concerns with this approach.
Beta Was this translation helpful? Give feedback.
All reactions