cjbassi / ytop

A TUI system monitor written in Rust
MIT License
2.16k stars 84 forks source link

incompatible definition of memory percentage #72

Open ho-oto opened 4 years ago

ho-oto commented 4 years ago
スクリーンショット 2020-04-24 12 19 00

What is the definition of the percentage of Main memory (72%) in the "Memory Usage" panel? It should be 59%(=100*4.73/8), I think.

CosmicHorrorDev commented 4 years ago

I believe ytop is getting two different values for this. An example on my machine for context.

From gotop:
42% 2.63 GiB/7.45 GiB
❯ free -h
              total        used        free      shared  buff/cache   available
Mem:          7.4Gi       2.6Gi       3.2Gi       255Mi       1.6Gi       4.3Gi
Swap:            0B          0B          0B

So the 2.63 GiB/7.45 GiB seems to be used/total while the percentage 42% is based on (total - available) / total.

I do agree that this seems confusing when the two types of reporting are not the same, but I'm not sure how it should be dressed. Maybe some text to denote that they are actually different values?