-
-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
used
/ available
/ free
memory is wrong on Linux
#1071
Comments
used
/ available
/ free
memory is wrong on Linux
/proc/meminfo
|
What does |
No, I think I have all needed. You can also check what's wrong yourself, which would be much faster than waiting for me as I'm a super busy lately... The code which gets this information is in https://github.com/GuillaumeGomez/sysinfo/blob/0.29/src/linux/system.rs#L252. If you could check what is done wrong, it'd be really helpful (sending a fix would be the best! :D) |
I also meet this problem and I think if we want to get used / avialble / free memory like command "free -h",maybe we should not use the part of cgroups to sub our memory (https://docs.rs/sysinfo/0.29.10/src/sysinfo/linux/system.rs.html#286-318) |
I'm really confused about this cgroup thing. Maybe there is a way to figure out when to use it or not... |
After looking at the |
I'm investigating this issue again. @srid, can you provide me the content of the following files please:
|
In the meantime, I decided to move the cgroup limits computation into its own function so it can be queried separately in #1119. |
Describe the bug
My environment,
sysinfo.version = "0.29.10"
The following Rust code,
outputs:
Note that both free and available are detected as 6GB, which is wrong. The correct values are reported by the free command:
To Reproduce
https://github.com/juspay/nix-browser/compare/2a2e72fc6aafba640b94bc18d418377716a240e7..2a7404807db29bd1005ef1d5b2be62a800dac791
The text was updated successfully, but these errors were encountered: