Huge Pages in CentOS 6

To check the size and amount of Huge Pages use:

grep -i Hugepage /proc/meminfo

This should so something like:

HugePages_Total:    0
HugePages_Free:     0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB

To change the number of HugePages use the following:

sysctl -w vm.nr_hugepages=2560

This would allocate 2560x2048kB = 5GB

grep -i Hugepage /proc/meminfo
AnonHugePages:     10240 kB
HugePages_Total:    2560
HugePages_Free:     2560
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB

To check the impact on memory:

grep -i memfree /proc/meminfo

Reset Huge Pages

The change can be applied permanently in /etc/sysctl.conf but to switch the number of Huge Pages back to zero:

sysctl -w vm.nr_hugepages=0

And check again with:

grep -i Hugepage /proc/meminfo
grep -i memfree /proc/meminfo

 

 

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>