Star Hype News.

Premium celebrity moments with standout appeal.

general

How to show actual memory usage instead of "%MEM"

By Matthew Cannon

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)?

3

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

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:

System Monitor

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 0B

used = total - free - buffers - cache

free -h will give memory details in MB and GB.

The free manpage is here:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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