mirror of
https://git.proxmox.com/git/pve-common
synced 2025-04-28 12:10:17 +00:00
procfs: also return MemAvailable when parsing meminfo
To promote using this over the rather useless, or well very different, MemFree. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
219fe335b6
commit
81aee5bd53
@ -279,6 +279,7 @@ sub read_meminfo {
|
||||
my $res = {
|
||||
memtotal => 0,
|
||||
memfree => 0,
|
||||
memavailable => 0,
|
||||
memused => 0,
|
||||
memshared => 0,
|
||||
swaptotal => 0,
|
||||
@ -300,6 +301,7 @@ sub read_meminfo {
|
||||
|
||||
$res->{memtotal} = $d->{memtotal};
|
||||
$res->{memfree} = $d->{memfree};
|
||||
$res->{memavailable} = $d->{memavailable};
|
||||
# NOTE: MemAvailable is the only metric that will actually represent how much memory is
|
||||
# available for a new workload, without pushing the system into swap, no amount of calculating
|
||||
# with BUFFER, CACHE, .. will get you there, only the kernel can know this.
|
||||
|
Loading…
Reference in New Issue
Block a user