oguzhaninan / Stacer

Linux System Optimizer and Monitoring - https://oguzhaninan.github.io/Stacer-Web
GNU General Public License v3.0
8.82k stars 600 forks source link

RAM meter shows terrabyte usage with only a few gigs in actual use #501

Open TwoFistedJustice opened 1 year ago

TwoFistedJustice commented 1 year ago

Stacer showed my RAM usage to be in terrabytes while System Monitor showed less than 3 gigs.

Kubuntu 20.04 I was running Chromium, Docker Desktop (no containers running), PhpStorm and WebStorm.

First RAM showed very low, a few hundred MB then the bar jumped to the 50% mark and showed 16777216.0TiB. It occasionally drops back down to a few hundred and then back to the same TiB amount with the bar always stopping at exactly the halfway point.

stacer terrabytes

amiga-500 commented 1 year ago

Looks like it is reading in the value as a negative as it gets lower and lower which, possibly because its a unsigned variable, then reverts to showing it misleadingly as a really high value (16.7 million). What i cant figure out is which intrinsic type in C++ (the code its written in) has a max value of 16.7m TiB. I dunno. I've only ever seen 16.7m as a max color value. I wonder then if maybe its trying to convert an invalid string value into a # (or viceversa) and getting it wrong e.g. Stacer is parsing incorrectly because the input value contains an illegal character.

For the record i am using Ubuntu 20.04 with 32GiB and Stacer doesnt have this problem. I might roam the code to see what part in the memory display could possibly due what ur snapshot shows.

guilty-p01nt3r commented 1 year ago

There is something wrong with the measuring of the used memory: image

One way to replicate the bug is to close all the applications except for firefox and Stacer, then close stacer and you will get the negative number for the unsigned int that translates to the terabyte used memory.

You can also see that the memory usage shown is somehow lower than the real one, maybe that's the source of the problem: image

I hope this can help solve it