top
command, and press M to check whether there are processes in the “RES” and “SHR” columns using much memory.cat /proc/meminfo | grep -i shmem
cat /proc/meminfo | grep -i SUnreclaim
cat /proc/meminfo | grep -iE "HugePages_Total|Hugepagesize"
HugePages_Total
output is 0
, see the memory issue analysis to find the causes of problems.HugePages_Total
output is not 0
, there are huge pages. The huge page size equals to HugePages_Total * Hugepagesize
. Check whether huge pages are configured by a malicious program, or if they are unnecessary, you can comment out the vm.nr_hugepage
configuration item in the /etc/sysctl.conf
file, and then run the sysctl -p
command to abandon huge pages.free
command output may vary with the Linux distributions, which is unreliable for calculating the memory utilization. Perform the following steps to view the memory utilization on the Monitoring page of the CVM console.(Total - available)100% / Total
= (Total - (Free + Buffers + Cached + SReclaimable - Shmem)) * 100% / Total
= (Total - Free - Buffers - Cached - SReclaimable + Shmem) * 100% / Total
Total
, Free
, Buffer
, Cached
, SReclaimable
, and Shmem
can be obtained in /proc/meminfo
. Below is an example of /proc/meminfo
.1. [root@VM_0_113_centos test]# cat /proc/meminfo2. MemTotal: 16265592 kB3. MemFree: 1880084 kB4. ......5. Buffers: 194384 kB6. Cached: 13647556 kB7. ......8. Shmem: 7727752 kB9. Slab: 328864 kB10. SReclaimable: 306500 kB11. SUnreclaim: 22364 kB12. ......13. HugePages_Total: 014. Hugepagesize: 2048 kB
Parameter | Description |
MemTotal | Total system memory |
MemFree | Free memory |
Buffers | Cached page used by block devices for reads/writes and file system metadata (such as SuperBlock) |
Cached | Page cache, including POSIX/SysV shared memory and shared anonymous mmap of tmpfs |
Shmem | Including shared memory, tmpfs, etc. |
Slab | Memory allocated by the kernel slab memory allocator, which can be viewed using the slabtop command |
SReclaimable | Reclaimable slabs |
SUnreclaim | Non-reclaimable slabs |
HugePages_Total | Total number of huge pages |
Hugepagesize | Size of a huge page |
Was this page helpful?