Ubuntu

4 ways to check an available memory in Ubuntu 20.04 LTS

Check memory usage in Debian 10

Introduction:

The main job of RAM or memory in any computer system is to fetch the programs from the hard disk, hold them temporarily, schedule their processing, and then send them one by one to the CPU for execution. This memory can hold a process only if it has a sufficient amount of space available to accommodate that process. That is why it is extremely important for a user in general and a system administrator, in particular, to frequently monitor the available memory. Today we intend to share with you all the different methods of checking the available memory in Ubuntu.

Note: We have demonstrated the methods of checking the available memory using Ubuntu 20.04.

Methods of Checking the Available Memory in Ubuntu:

There are different methods of checking the available memory in Ubuntu 20.04. Below we have listed down the four most effective methods of doing so.

Method # 1: Using the “top” Command:

The “top” command is used in Ubuntu to display your CPU and memory statistics along with the information about the currently running processes. To use this command for checking the available memory in Ubuntu 20.04, you should essentially perform all the following steps:

After launching the terminal in Ubuntu 20.04 by looking for it in the Activities menu, you need to run the command stated below in your terminal:

top

Running this command will display a detailed output on the terminal. Out of all that information, the chunk with which we are concerned is highlighted in the following image. The highlighted portion represents the free memory and the free swap memory respectively. Also, there is a dedicated entry for the available memory in the output of this command.

Method # 2: Using the “free” command along with the “-m” Flag:

The “free” command in Ubuntu is used to display the current memory usage of your system. To use this command for checking the available memory in Ubuntu 20.04, you should perform the steps stated below:

After launching the terminal in Ubuntu 20.04 by looking for it in the Activities menu, you need to run the following command in your terminal:

free –m

Running this command will display the output which contains information such as free memory, total memory, used memory, etc. Free memory and free swap memory are also highlighted in the image shown below. Also, there is a dedicated entry for the available memory in the output of this command.

Method # 3: Using the “cat” Command with “/proc/meminfo”:

The /proc/meminfo file in Ubuntu contains all the information about the memory usage of your system. For using this file to check the available memory in Ubuntu 20.04, you should perform the following steps:

After launching the terminal in Ubuntu 20.04 by looking for it in the Activities menu, you need to run the following command in your terminal:

cat /proc/meminfo

Here, the “cat” command has been used to display the contents of the /proc/meminfo file on the terminal.

In the output of this command, there will be several memory statistics available that you can examine as per your needs. However, we have highlighted the free memory and the free swap memory entries in the image shown below. Also, there is a dedicated entry for the available memory in the output of this command.

Method # 4: Using the “vmstat” command along with the “-s” Flag:

The “vmtstat” command in Ubuntu is used to display all the virtual memory statistics. To use this command for checking the available memory in Ubuntu 20.04, you will have to perform the following steps:

After launching the terminal in Ubuntu 20.04 by looking for it in the Activities menu, you need to run the command stated below in your terminal:

vmstat –s

The output of this command is very much similar to the output shown in Method # 3. However, there is no dedicated entry for the available memory in the output of this command. The free memory and the free swap memory are highlighted in the following image:

Conclusion:

In this article, we shared with you four different methods of checking the available memory in Ubuntu 20.04. You can also execute these methods on any other Linux distribution of your choice. By following any of these methods, you can check the available memory along with lots of other useful memory statistics of your Ubuntu 20.04 system.

Similar Posts