dylanaraps / neofetch

🖼️ A command-line system information tool written in bash 3.2+
MIT License
22.01k stars 1.77k forks source link

Memory labels and memory usage errors #644

Closed ghost closed 7 years ago

ghost commented 7 years ago

I ran Neofetch and Screenfetch at the same time and got very different output for memory. Neofetch incorrectly labels the units, and detects much higher usage.

Ksysguard: 3.6GiB / 7.8GiB

Neofetch:

Memory: 4570MB / 8009MB

Screenfetch:

RAM: 3827MiB / 8009MiB

free:

              total        used        free      shared  buff/cache   available
Mem:        8202148     3781380      462600      895756     3958168     3238208
Swap:      12582908      111052    12471856
dylanaraps commented 7 years ago

Neofetch's memory usage is correct.

Screenfetch's git master will show the same output as Neofetch since they implemented our method of memory calculation. https://github.com/KittyKatt/screenFetch/commit/3cdcc265a4a7c75b86bfc0508c073a5e41ecbf95#diff-2cb90a66b50ac7ceca99b2935a542ddeR1377

See this entry in the FAQ: https://github.com/dylanaraps/neofetch/wiki/Frequently-Asked-Questions#linux-is-neofetchs-memory-output-correct

dylanaraps commented 7 years ago

Now about the unit labeling, I'm open to changing it to MiB if our labeling is in fact incorrect.

ghost commented 7 years ago
The correct way to calculate memory

What makes it 'correct'? You should add an explanation to the FAQ page. Right now it just says 'everyone else is wrong but we're not.'

if our labeling is in fact incorrect.

1MB = 1000 1000 = 1000000B 1MiB = 1024 1024 = 1048576B https://en.wikipedia.org/wiki/Mebibyte

dylanaraps commented 7 years ago

Right now it just says 'everyone else is wrong but we're not.'

The FAQ page says that everyone (Including neofetch) was calculating memory incorrectly until late 2016. Every tool listed on that page now displays the correct amount whether it's in a development branch or release.

What makes it 'correct'? You should add an explanation to the FAQ page.

I'm calling it 'correct' because all other tools calculate memory this way. The tools/scripts screenfetch-dev, htop, conky, free and monit were all updated recently to calculate memory like this.

dylanaraps commented 7 years ago

Labels have been fixed.

dylanaraps commented 7 years ago

I don't know if you want to continue this discussion or not so I've left the issue open.