diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:45:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:45:55 +0000 |
commit | a8220ab2d293bb7f4b014b79d16b2fb05090fa93 (patch) | |
tree | 77f0a30f016c0925cf7ee9292e644bba183c2774 /collectors/proc.plugin/proc_meminfo.c | |
parent | Adding upstream version 1.19.0. (diff) | |
download | netdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.tar.xz netdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.zip |
Adding upstream version 1.29.0.upstream/1.29.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | collectors/proc.plugin/proc_meminfo.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/collectors/proc.plugin/proc_meminfo.c b/collectors/proc.plugin/proc_meminfo.c index 92135393d..51d77fe0b 100644 --- a/collectors/proc.plugin/proc_meminfo.c +++ b/collectors/proc.plugin/proc_meminfo.c @@ -35,7 +35,7 @@ int do_proc_meminfo(int update_every, usec_t dt) { Writeback = 0, //AnonPages = 0, //Mapped = 0, - //Shmem = 0, + Shmem = 0, Slab = 0, SReclaimable = 0, SUnreclaim = 0, @@ -92,7 +92,7 @@ int do_proc_meminfo(int update_every, usec_t dt) { arl_expect(arl_base, "Writeback", &Writeback); //arl_expect(arl_base, "AnonPages", &AnonPages); //arl_expect(arl_base, "Mapped", &Mapped); - //arl_expect(arl_base, "Shmem", &Shmem); + arl_expect(arl_base, "Shmem", &Shmem); arl_expect(arl_base, "Slab", &Slab); arl_expect(arl_base, "SReclaimable", &SReclaimable); arl_expect(arl_base, "SUnreclaim", &SUnreclaim); @@ -145,8 +145,8 @@ int do_proc_meminfo(int update_every, usec_t dt) { // -------------------------------------------------------------------- - // http://stackoverflow.com/questions/3019748/how-to-reliably-measure-available-memory-in-linux - unsigned long long MemCached = Cached + SReclaimable; + // http://calimeroteknik.free.fr/blag/?article20/really-used-memory-on-gnu-linux + unsigned long long MemCached = Cached + SReclaimable - Shmem; unsigned long long MemUsed = MemTotal - MemFree - MemCached - Buffers; if(do_ram) { @@ -526,4 +526,3 @@ int do_proc_meminfo(int update_every, usec_t dt) { return 0; } - |