To find memory (RAM) usage information on CentOS Linux, you can use the free
command or the vmstat
command.
free
command. The free
command displays the total amount of physical and swap memory on the system, as well as the amount of memory that is used, free, and available.For example:
free -h
This will display the amount of memory in human-readable format (e.g., KB
, MB
, GB
).
vmstat
command. The vmstat
command displays statistics about memory, CPU, I/O, and other system resources.For example:
vmstat -s
This will display the total amount of memory on the system, as well as the amount of memory that is used, free, and available.
You can also use the vmstat
command with the -m
option to display information about memory usage by kernel modules:
vmstat -m
This will display the amount of memory used by each kernel module on the system.
It's a good idea to monitor your system's memory usage to ensure that you have enough memory available for your applications and processes. If your system is running low on memory, you may experience performance issues or system instability. You can use the free
or vmstat
command to help diagnose and troubleshoot memory issues on your system.