How to check memory utilization and usage in Linux

There are several ways to check memory utilization and usage in Linux:

  1. free command: The free command is used to check the total amount of free and used physical and swap memory in the system, as well as the shared memory and buffers used by the kernel.
$ free -m
  1. top command: The top command provides a real-time view of the processes running on the system, including the memory usage of each process. Press ‘Shift + m’ to sort the process by memory usage.
$ top
  1. vmstat command: The vmstat command provides information about system processes, memory, paging, block IO, traps, and CPU activity.
$ vmstat -s
  1. htop command: The htop command provides an interactive process viewer similar to the top command, but with additional features such as color-coded system status and memory usage.
$ htop
  1. /proc/meminfo : You can also check the memory usage by reading the /proc/meminfo file, which contains information about the system’s memory usage.
$ cat /proc/meminfo

These commands will give you an idea of the current memory utilization and usage on your Linux system, and help you identify any potential issues or bottlenecks.

Leave a Comment