There are several ways to check memory utilization and usage in Linux:
free
command: Thefree
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
top
command: Thetop
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
vmstat
command: Thevmstat
command provides information about system processes, memory, paging, block IO, traps, and CPU activity.
$ vmstat -s
htop
command: Thehtop
command provides an interactive process viewer similar to thetop
command, but with additional features such as color-coded system status and memory usage.
$ htop
/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.