Method: 1. Use the free command. This command is used to display the memory status. When the parameter is set to "-m", the memory usage will be displayed in MB. The syntax is "free -m"; 2 . Use the top command, which can also be used to check memory usage. The syntax is "top".
The operating environment of this article: centos 7 system, Dell G3 computer.
1. Free command:
free -m command can check the overall memory of the Linux operating system Situation
Linux free command is used to display memory status.
The free command will display memory usage, including physical memory, virtual swap file memory, shared memory segments, and buffers used by the system core.
Syntax
free [-bkmotV][-s <间隔秒数>]
Parameter description:
-b Displays the memory usage in Byte.
-k Displays memory usage in KB.
-m Displays memory usage in MB.
-h Display memory usage in appropriate units, up to three digits, and automatically calculate the corresponding unit value.
2. top command:
top is also often used, you can check the system memory , CPU usage function. When the system load is high, this command can view the processes currently occupying high system memory for system tuning.
top command to check the memory usage. Mem means memory. How much is the total, how much is used, how much is free, and the buffer is the I/O cache
Recommended tutorial: "centos tutorial"
The above is the detailed content of How to check the memory of centos. For more information, please follow other related articles on the PHP Chinese website!