-
Notifications
You must be signed in to change notification settings - Fork 813
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
Adding support for MemAvailable #1993
Conversation
See discussion at https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 - MemAvailable is preferable to manually calculating using MemFree, Buffers, Cached, Shared, etc.
This will need some changes in the backend as well. |
@remh I was adding the MemAvailable stuff to the backend, but it kind of feels like redundant. Maybe we should just report MemAvailable as MemUsable when its available, and compute usable when it's not available (aka. like it's done now). Thoughts? |
e014fb9
to
a0efe9a
Compare
It doesn't make sense to report usable and available. We just use available if the kernel has it, or compute usable if it's not. |
memData['physUsable'] = int(meminfo.get('MemAvailable', 0)) / 1024 | ||
else: | ||
# Usable is relative since cached and buffers are actually used to speed things up. | ||
memData['physUsable'] = memData['physFree'] + memData['physBuffers'] + memData['physCached'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't look like physBuffers
and physCached
are populated until L374-375 . Maybe move this block of code below that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting that! Careless.
👍 |
Adding support for MemAvailable
@remh the thing is MemAvailable was introduced precisely because it's not always so straight-forward to estimate the amount of memory available to the system: https://access.redhat.com/solutions/776393. As it turns out the typical way of doing |
Based on: #1826 - bringing in @jraede changes and making sure it's only reported if the kernel actually has it in
/proc/meminfo