×

Are you trying to check the available memory in your Linux Server? 

This guide will help you.


RAM or memory in any computer system helps 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.

To find out the available and used disk space, use df (disk filesystems, sometimes called disk free). To discover what's taking up the used disk space, use du (disk usage). Type df and press enter in a Bash terminal window to get started. 


Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to troubleshoot their Linux System.

In this context, we shall look into the different methods of checking the available memory in Ubuntu.


How to check the Available Memory in Ubuntu ?

There are different methods of checking the available memory in Ubuntu 20.04. 

Below we have outlined the most effective methods of doing so.


1. How to use the "top" Command to check Available Memory ?

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

Executing this command will display a detailed output on the terminal. Out of all that information. Here you will see the free memory, the available memory and the free swap memory respectively. 


2. How to use the "free" command along with the "-m" Flag to check Available Memory ?

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

Executing this command will display information such as free memory, total memory, used memory, available memory and free swap memory.


3. How to use 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.


4. How to use "vmstat" command along with the "-s" Flag to check memory?

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


[Need urgent assistance to perform Linux related tasks? We are available to help you today. ]


Conclusion