Skip to content

"used" ram meaningless on linux + give wrong 'total'. #450

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

Closed
orzel opened this issue Jan 12, 2024 · 1 comment · Fixed by #462
Closed

"used" ram meaningless on linux + give wrong 'total'. #450

orzel opened this issue Jan 12, 2024 · 1 comment · Fixed by #462
Labels
bug Something isn't working

Comments

@orzel
Copy link

orzel commented Jan 12, 2024

On linux/python, the Memory:used is fetched from psutil, but it's nothing really interesting. It corresponds to nothing in top for example.

That's, by itself, is a problem. But the code in library/stats.py uses it to compute total. This is wrong, as explained on the psutil documentation itself.

For ex on one system, i got 128G of RAM, reported as 125 by psutil.virtual_memory().total, which is fine. But free is 42.7 and used 6.4, and as such turing-smart-screen-python displays "49.2". As a side note, i have no idea what those 6.4 are...

@orzel orzel added the bug Something isn't working label Jan 12, 2024
@mathoudebine
Copy link
Owner

Thanks for raising this issue, I was not aware of this
Basically we can use (total - available) for used memory
I'll create a PR for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants