How to show actual memory usage instead of "%MEM"
In Linux, when using top to see how much memory a process is using, how do you force the thing to actually tell you how much memory things are using (instead of having it obfuscate the actual value by giving derived percentages)?
2 Answers
If you are looking for process-level memory usage in human-readable numbers, then top may not be the solution for you. It is not particularly versatile on Ubuntu (or Fedora). Instead you might find glances to be a bit more useful:
Glances is probably overkill for most people, but it does give a pretty good overview of the system. You can sort on columns if you're interested in seeing which processes are consuming the most memory, CPU, or I/O. It does consume a noticeable bit of CPU itself, though, particularly when there are Docker containers running on the host.
This works well for both Ubuntu Server and Desktop.
$ sudo apt install glances If this is only for Ubuntu Desktop, then one of the two system monitor options should give you what you're looking for:
These will show memory usage in MB/GB with more easily sortable columns.
free
free will give total, used, free, shared, buff/cache and available memory in KiB. It also shows total, used and free for swapspace and swap partition.
free -h total used free shared buff/cache available
Mem: 3.5G 775M 1.7G 86M 1.0G 2.4G
Swap: 0B 0B 0Bused = total - free - buffers - cache
free -h will give memory details in MB and GB.
The free manpage is here: