Description of problem:
The /usr/bin/top utility displays memory in lines 4 and 5 on screen in units of kilobytes, this is silly, and it overflows if server has 128 GB RAM. Why not display it in megabytes, this would make display more readable and compact. If people really want to know how many KB are available, they can read /proc/meminfo
Version-Release number of selected component (if applicable):
RPM version procps-ng-3.3.8-15.el7.x86_64
Steps to Reproduce:
1. Find server with 128 GB RAM
2. run /usr/bin/top on it
KiB Mem: 13198875+total, 2453360 used, 12953539+free, 2404 buffers
KiB Swap: 4194300 total, 0 used, 4194300 free, 947368 cached
MiB Mem: 131072 total, nnnnn used, 131072-nnnnn free
and so on
The unit is configurable with [Shift]+[E] and you can write the configuration with [Shift]+[W].
You can switch between KiB, MiB, GiB, TiB, PiB and EiB.
NOTE: You can also switch the column units by pressing [e].
Please, let me know if that satisfies your needs.
First of all, it really isn't a question of whether it satisfies my needs. The question is whether the default unit (KiB) satisfies the average user's needs.
It's nice that you can reconfigure it to a better unit, but that is almost irrelevant -- IMHO it should be a goal for all software should work without reconfiguration in most cases. Since it is reconfigurable, there is even less reason to hang onto the old default of KiB, since the few people who need the unit of kilobytes can still use it. An increasing number of server configs will have > 100 GB RAM, and a decreasing number (zero?) will have < 10 MB RAM. So I'm trying to propose the simplest solution for the developer.
Also, the display is just wrong when it is in units of KiB, see above. Perhaps the unit of KiB should be disabled when the field is overflowing?
Please, propose the changes upstream. The 'top' tool is maintained by Jim Warner and I'm willing to backport the change once it appears in the upstream repository.
Upstream plans to cover this issue in one of the next versions of the software.
When it is ready, a backport patch can be expected.
Ben, if you like, you can simply create your own configuration the way you propose.
1. run top
2. press 'e' (to scale memory in Task Area to MiB)
3. press 'E' (to scale memory in Summary Area to MiB)
4. press 'W' to create/rewrite your own ~/.toprc file (Section 6b in top's manpage)
Next time you run top, your configs will be loaded.
You can also add colors by pressing 'z', "tree" tasks by pressing 'V' and add usage bars by pressing 't' for CPUs and 'm' for memory repeatedly to your liking.
This is, by the way, the look of "modern top".
Again, save the changes by hitting 'W'.
ok, I surrender ;-) I didn't realize that you could persist the settings or change the defaults (by copying the config file). Anyway, as you said I think the default should change in the next major release.
(In reply to Ben England from comment #15)
> ok, I surrender ;-) I didn't realize that you could persist the settings or
> change the defaults (by copying the config file). Anyway, as you said I
> think the default should change in the next major release.
Working on it.