The top command is a powerful way to see what is consuming your precious system memory. Here’s how to sort the top output by memory usage.
Figuring out which processes are using the most memory isn’t as easy on Linux as it is on Windows. Fortunately, no matter what variant of Linux you’re using, that above Command makes it easy to see how much memory each process is using.
However, the top command doesn’t sort by memory usage by default, so it’s hard to see what is using the most RAM. If you’ve revived an old PC with a lightweight Linux distro, keep a close eye on what is eating up all of your RAM!
How to sort the top processes by memory usage in Linux with the terminal above Command.
Sort the top command output by memory usage
To use the top command, open up a terminal. You can use the keyboard shortcut on many systems Ctrl + Alt + T to do this, or tap terminal in the application search menu and open the command line from there.
To start the upper user interface, type above at the terminal prompt and press Input. This will bring up a display in the terminal with a list of the running processes, along with some general information about current tasks and processes running on your system.
By default, top does not display processes in order of memory usage. It’s easy to rearrange the menu with the keyboard shortcut Shift + M. This updates the list with the % MEM Column showing memory usage in descending order.
Unsurprisingly, Chromium eats up all of the RAM! To press Shift + M again updates the menu with the current top RAM users. To exit top and return to the terminal, press Q.
Monitoring of memory usage on Linux
The top command is good to master as it works on almost all Linux systems, but if you’ve come from Windows and are new to Linux, Ubuntu System Monitor may seem a little more familiar to you.
Alternatively, if you’re looking for an always-on widget that shows system information, there are tons of great things to do with Conky!
Have you ever looked at your Linux desktop and thought, “I could definitely improve this”? A great option is Conky, which can show everything from new topics to nicely crafted CPU temperature data.
About the author