top used to support the '-M' option. It was used decide which units memory was displayed in for the machine Kib, MB, GiB etc. On RHEL 6.x this works, but it is not supported on later releases of the procps package. On RHEL 7.x it's not available as an option. Does anyone know if there is an alternative command line option for top, or why it was removed?


I don't know why it was removed, but in current versions of procps top you can change the scaling in the summary window using E, and in the task window using e; successive keypresses move through the various scales available.

The settings can be stored in a configuration file; set things up as you like them, and press W to store all the settings in ~/.toprc. The relevant settings for memory scaling are Summ_mscale and Task_mscale, e.g.

Summ_mscale=2, Task_mscale=1

in ~/.toprc uses GiB in the summary and MiB in the task list. There doesn't seem to be a way of specifying this on the command line.

| improve this answer | |

The -M option was a non-standard RedHat addition. It was never part of the standard procps top. I'm not sure why it was removed, possibly it interfered with the scaling in other parts of top.

So you have two choices.

  1. Set the scaling with the E key, as explained above
  2. Use the -E option, for example top -E g will show the units in GB. You get the choices of k,m,g,t,p,e (for those times you have something using Exbibytes!)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.