pimatic / pimatic-sysinfo

Plugin for displaying system and process information such as CPU and Memory usage for pimatic
https://pimatic.org/
GNU General Public License v2.0
2 stars 4 forks source link

Memory Usage shows totally different values than Taskmanager #19

Closed akicker closed 5 years ago

akicker commented 5 years ago

Sysinfo 0.9.5 shows about double values (M USED) than taskmanager, ... image

mwittig commented 5 years ago

Memory usage on Linux is captured by fetching data from /proc/meminfo. Can you please post a cat /proc/meminfo and a screenshot of the figures shown in the Taskmanager at the same time? Thanks!

akicker commented 5 years ago

hi, meminfo shows: image stepping back to Sysinfo 0.9.4 shows more plausible values!

akicker commented 5 years ago

... one more info using the command free ... used total matches with taskman ;-) image

mwittig commented 5 years ago

Thanks. The difference is that TaskManager shows MemAvailable instead of MemFree. MemAvailable is an estimation of MemFree plus reclaimable memory (buffers and cache).

// |------------------------------------------------------------|
// |                           R A M                            |
// |______________________|_____________________________________|
// |                      |      available (6) estimated        |
// |______________________|_________________________|___________|
// |     active (2)       |   buffers/cache (5)     | free (3)  |
// |________________________________________________|___________|
// |                          total (1)                         |
// |____________________________________________________________|
//

See also: http://www.software-architect.net/blog/article/date/2015/06/12/-826c6e5052.html

In summary, there are different interpretation on what memory used and free are. As a compromise I'll provide memory active and available as additional attributes with the next version.

akicker commented 5 years ago

OK, the issue is how used is defined ;-) in the previous version 0.9.4 memory was defined as res.total - res.avail see: ../node_modules/pimatic-sysinfo/sysinfo.coffee now 0.9.5 you are showing usedMemory as res.used (looks like total - free) raspbian taskman shows: memory consumption (total- avail) command free uses: used = total - free - buffers - cache command top shows similar values as free I think the old definition (total-avail) says more on the health of the system!

mwittig commented 5 years ago

I think the old definition (total-avail) says more on the health of the system!

I agree with this and will change the values for memoryUsed (= Active) and memoryFree (= Available) with the next release.

akicker commented 5 years ago

Great, working perfect now 👍

mwittig commented 5 years ago

Excellent! I am closing this now.