elvetemedve / gnome-shell-extension-system-monitor

Gnome Shell extension for displaying resource usage
GNU General Public License v3.0
87 stars 15 forks source link

Do not match GNOME System Monitor #77

Closed ai closed 3 years ago

ai commented 3 years ago

Fedora 33. I started all application to have out of the memory (for both RAM and swap) in GNOME System Monitor but extension shown only 39%.

Screenshot from 2021-05-08 00-51-38

elvetemedve commented 3 years ago

Hi @ai,

Calculating the RAM usage is not trivial as Linux kernel accounting does not provide a single value as "used RAM", but usage is split across categories. You can see how Linux tracks memory allocation by running cat /proc/meminfo. The extension implemented the same formula for calculating RAM usage as the htop application which looks like this:

https://github.com/elvetemedve/gnome-shell-extension-system-monitor/blob/master/System_Monitor%40bghome.gmail.com/meter.js#L278-L279

Gnome's System Monitor must use a different formula I suppose.

I don't have information about which calculation method is the correct/official.

ai commented 3 years ago

Fixed in https://github.com/elvetemedve/gnome-shell-extension-system-monitor/pull/78