Created attachment 138654 [details] They disagree on memory usage See attached screenshot. System Monitor says 7.8 GiB are used; KsysGuard says 5 GiB are used. `free` seems to have numbers closer to ksysguard, not System Monitor. Is System Monitor adding used and shared together? $ free total used free shared buff/cache available Mem: 16000340 5575520 1756448 2539232 8668372 7548948 Swap: 16777212 15616 16761596
plasma-systemmonitor (or actually, ksystemstats) uses `total - available` for the used amount, which should be the "correct" number, as available represents the amount of memory that is available to applications. From your example, 16000340 - 7548948 = 8451392 which, converted to GiB is 8.05987548828125 which is ... more than 7.8 GiB but a lot closer to that number.
Why does total minus available not equal free though? That doesn't make a lot of sense to me.
Note that this matches the behaviour of, among others, Gnome system monitor. In fact, we changed this behaviour to match that originally. > Why does total minus available not equal free though? That doesn't make a lot of sense to me. Which free? The one from "free" or the "free physical memory" from ksystemstats?
I mean used, not free. Sorry. Because 16000340 - 7548948 = 8451392, so if that's how much memory is used, then what does the "used" column in `free` (the CLI program) mean? I don't get how that number is 5575520, not 8451392.
From the "free" manpage: > used Used memory (calculated as total - free - buffers - cache) vs: > available Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided by the cache or free fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use (MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as free) Or in other words, free does the same thing ksysguard did, which is actually an incorrect representation of the amount of memory used because as the free manual states, there are several things to consider when looking at the actual available memory.
Got it. Very interesting.