Rocky Linux

How to Check the Memory Usage on Rocky Linux 9

Checking the memory usage is essential because it directly impacts the performance of your system. High memory usage also damages the system’s hardware-related issues. Moreover, there are also certain situations where the malware or any malicious process consumes more memory usage. Hence, checking the memory usage can help prevent security threats from your system.

Overall, it is good to check the memory usage to maintain the system’s performance, security, efficiency, and stability. However, if you don’t know how to check the memory usage in Linux, this guide is for you. In this guide, we will explain the various methods to check the memory usage on Rocky Linux 9 (RHEL-based OS).

How to Check the Memory Usage on Rocky Linux 9

Let’s divide this section into two parts where the first one includes the commands and the second one includes the GUI tools to check the memory usage:

The CLI Approach

Here, we included the different commands that you can run to display the memory usage in the terminal.

Free Command

The free command displays a brief information about memory usage including the used, free, and the total available memory. For example, let’s use the -h option with the “free” command to display the memory usage in the human-readable format:

free -h

Vmstat Command

You can use the vmstat command because it also reports the memory statics including paging, swapping, and memory usage activity:

vmstat

Top Command

You can use the “top” command if you want the in-depth details about memory usage.

top

Press the SHIFT and M keys to sort the processes according to the memory consumption.

The GUI Approach

If you don’t want to get involved in the commands, you can use the various GUI tools just by installing them in your system.

GNOME System Monitor

GNOME System Monitor displays the real-time details about the system resources such as memory usage, CPU usage, PID, etc. Although the GNOME System Monitor comes as a preinstalled utility, you can run the following command for the installation if you have removed it:

sudo dnf update

sudo dnf install gnome-system-monitor

To launch the GNOME System Monitor, run the following command and the system will open a new window:

gnome-system-monitor

Conclusion

This is all about the simple approaches that you can follow to check the memory usage on Rocky Linux 9. We included the GUI and CLI methods to display the memory usage and other important information about the system. Furthermore, more GUI tools are available in Linux, but as we previously mentioned, the GNOME System Monitor is a preinstalled utility. Therefore, it becomes easy for a user to access the tool and get an information about memory usage.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.