You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When my golang application runs in a container, it does read the limits from the Host and not from the current container it resides in.
it results in "131072 MB" ca. 128GB. The problem is: the container is limited to 4G and can not get more than this!
Expected behavior
Since I can easily read/get the actual total available memory (within a container) by reading this file: /sys/fs/cgroup/memory.max (available within a container!) I think the tool shall report back what actually is available to the container (if within a container) as the host does not really matter. If the host has 12GB, 128GB or 1TB RAM does not matter to the container. For within a container solely its available memory is relevant.
Environment (please complete the following information):
docker scratch container. Sorry nothing to grep here ..
Additional context
I did not cross compile. I am still using Linux (Debian Testing) under the hood. Here the /etc/os-release from the host.
Some time ago I already encountered this issue and now, since it is the second time, I thought maybe opening an issue is worth it ;)
Feel free to convert this to a feature request if you like to.
Also, in the meantime I made my own little function that gets me what I want, so I wanted to share it, maybe it can be implemented in the package ;)
Describe the bug
When my golang application runs in a container, it does read the limits from the Host and not from the current container it resides in.
To Reproduce
it results in "
131072 MB
" ca. 128GB. The problem is: the container is limited to 4G and can not get more than this!Expected behavior
Since I can easily read/get the actual total available memory (within a container) by reading this file:
/sys/fs/cgroup/memory.max
(available within a container!) I think the tool shall report back what actually is available to the container (if within a container) as the host does not really matter. If the host has 12GB, 128GB or 1TB RAM does not matter to the container. For within a container solely its available memory is relevant.Environment (please complete the following information):
docker scratch container
. Sorry nothing to grep here ..Additional context
I did not cross compile. I am still using Linux (Debian Testing) under the hood. Here the
/etc/os-release
from the host./etc/os-release
Some time ago I already encountered this issue and now, since it is the second time, I thought maybe opening an issue is worth it ;)
Feel free to convert this to a feature request if you like to.
Also, in the meantime I made my own little function that gets me what I want, so I wanted to share it, maybe it can be implemented in the package ;)
since your tool does not give back MBs this version probably would be better for you:
The text was updated successfully, but these errors were encountered: