The memory (RAM) is one of the critical components in the server and it may slow down the server performance if the server memory is fully utilized.
In Linux, the free command is used to check the amount of free RAM memory in the system, which also shows swap space, buffer, and cache space. By default, most Linux distributions have free command inbuilt, so no package needs to be installed.
The below command will show the default view with kilobyte
units.
# free
Use -b (bytes), -k (kilobytes), -m (megabytes), -g (gigabytes) and -tera (terabytes) to check memory usage in other units. Run the below command for an example output of megabytes unit:
# free -m
Use the below command to display memory in human readable
.
# free -h
Run the bellow command to capture memory usage with delay and it will capture memory utilization every mentioned time seconds
and human-readable. In the below example it will capture memory utilization every 3 seconds and you can change the time value with the original.
# free -hs 3
Run the below command to show low & high memory statistics
.
# free -l
Get the information of total for every column, add -t option behind free command as below.
# free -t
Related Tutorials