Are you reaching maximum usage of your swap memory?
How to see swap memory in your Linux system?
You just landed at the right place to get unstuck. I am going to discuss some better and perfect new ways of observing swap memory for you. I’m using Lubuntu 20.04 to demonstrate all these processes. Lubuntu is a lightweight distro and runs effectively on most of the hardware.
Using GUI – The Simplest Way Possible
I always use the following two ways to determine existing swap memory on my system. I also want to let you know that I use SSDs; therefore, I do not need to configure swap memory. This is entirely a different discussion that why I don’t need to swap memory. However, all the instructions and commands discussed here will lead to checking and keeping swap memory not running out.
I use Htop to look into my system processes. It is utterly simple and gorgeous in looks because it uses quite a little of the RAM and shoots into the shell once launched. Below is the screenshot of hTop in action.
hTop is simple to use and can be installed right straight with the following command:
If you ever need to remove hTop, just run below command.”
The given command will make sure that everything is removed.
In my case, I do not use any swap; therefore, it is 0K/0K. Neither it flows in nor out.
The second GUI tool, qps, also has its benefits. Although it doesn’t run in a shell and takes its own memory space, it is very simple to use.
In the screenshot below, I show you how simple it is. I have launched it via the terminal to make the launch process a bit geekier. However, you can simply launch it from your start menu. As already discussed, it won’t show any swap memory in my case as I am not using it.
The program can be installed using the below command.”
Whereas, uninstall process is also similar:
All commands are valid for Debian and related distros that make use of .deb repositories.
Using Command Line Interface
Our geekier and simpler way to do anything in Linux is to get it done via command line.
Here, I’ll share and demonstrate to you a few commands.
Here is the simplest command out there in the Linux world.
The command free -h is handy when you want to see how much your swap memory is in total and how much it is in use.
Another command to check availability and consumed swap memory is to look into /proc/meminfo files.
Here is how to read the related file.
cat /proc/meminfo | grep -i swap
The given command will grab the total, free, and cached swap memory and display it on the terminal.
We discussed how to nail swap memory and make the best use of it. I used no swap on my Lubuntu distro, and all the commands and programs clearly showed that not a single bit is flowing throughout the system.