Oracle Linux: How To Calculate The Memory Reserved By HugePages (Doc ID 2546416.1)
APPLIES TO:
Linux OS - Version Oracle Linux 6.0 and later
Linux x86
Linux x86-64
GOAL
Calculate the percentage of memory reserved by Huge Pages. 计算Huge Pages保留的内存百分比
SOLUTION
- Inspect the memory parameters: 检查内存参数
# cat /proc/meminfo
MemTotal: 98721456 kB
MemFree: 1277612 kB
MemAvailable: 12186676 kB
Buffers: 20496 kB
Cached: 11013124 kB
SwapCached: 4820 kB
Active: 2303780 kB
Inactive: 9716992 kB
Active(anon): 716672 kB
Inactive(anon): 582092 kB
Active(file): 1587108 kB
Inactive(file): 9134900 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 33554428 kB
SwapFree: 32965424 kB
Dirty: 16856 kB
Writeback: 0 kB
AnonPages: 1004112 kB
Mapped: 308188 kB
Shmem: 290944 kB
Slab: 694100 kB
SReclaimable: 602280 kB
SUnreclaim: 91820 kB
KernelStack: 13792 kB
PageTables: 75736 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 40956756 kB
Committed_AS: 3011596 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 256480 kB
VmallocChunk: 34359477292 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 40975
HugePages_Free: 35867
HugePages_Rsvd: 13
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 163840 kB
DirectMap2M: 14516224 kB
DirectMap1G: 87031808 kB - Calculate the percentage of memory used by HugePages: 计算HugePages使用的内存百分比
memory% = (HugePages_Total * Hugepagesize) / MemTotal * 100.0
Use the values appropriate for your system, taken from the /proc/meminfo report. For example, from the example above:
使用适用于您系统的值,该值取自/proc/meminfo报告。例如,从上面的示例:memory% = (HugePages_Total * Hugepagesize) / MemTotal * 100.0 memory% = (40975 * 2048) / 98721456 * 100.0 memory% = 83916800 / 98721456 * 100.0 memory% = 85.04
The HugePages configuration reserves about 85% of the physical memory on the server.
HugePages配置了服务器上大约85%的物理内存
Note that all values in /proc/meminfo use the same units, so no conversion is necessary. 请注意,/ proc / meminfo中的所有值都使用相同的单位,因此无需进行转换。
REFERENCES
NOTE:1919605.1 - SRDC - Troubleshooting Oracle VM Server 3.x And Later Using The VMPinfo3 Diagnostic Capture Tool
NOTE:1998077.1 - Automated Troubleshooting Process