@cryptotaxi247 / netdata-1 / commits / e026f6c7f

fix ram usage calculation in LXC (#18695)

Ilya Mashchenko committed Oct 6, 2024 at 19:18 UTC e026f6c7f4e773a1e6d0994865a450cd6521dc5d
1 file changed +1 -1
src/collectors/proc.plugin/proc_meminfo.c
+1 -1
@@ -235,7 +235,7 @@ int do_proc_meminfo(int update_every, usec_t dt) {
235
236 // http://calimeroteknik.free.fr/blag/?article20/really-used-memory-on-gnu-linux
237 // KReclaimable includes SReclaimable, it was added in kernel v4.20
238 - unsigned long long reclaimable = KReclaimable > 0 ? KReclaimable : SReclaimable;
238 + unsigned long long reclaimable = inside_lxc_container ? 0 : (KReclaimable > 0 ? KReclaimable : SReclaimable);
239 unsigned long long MemCached = Cached + reclaimable - Shmem;
240 unsigned long long MemUsed = MemTotal - MemFree - MemCached - Buffers;
241 // The Linux kernel doesn't report ZFS ARC usage as cache memory (the ARC is included in the total used system memory)