此内容没有您所选择的语言版本。

14.6. Configuring Huge Pages in Red Hat Enterprise Linux 3


Before configuring Big Pages, ensure to have read Section 14.3, “Sizing Big Pages and Huge Pages”.
In Red Hat Enterprise Linux 3 the desired size of the Huge Pages pool is specified in megabytes. The size of the pool should be configured by the incremental size of the Huge Page size. To obtain the size of Huge Pages, execute the following command:
$ grep Hugepagesize /proc/meminfo
Hugepagesize:     2048 kB
$
Copy to Clipboard Toggle word wrap
The number of Huge Pages can be configured and activated by setting hugetlb_pool in the proc file system. For example, to allocate a 1GB Huge Page pool, execute:
# echo 1024 > /proc/sys/vm/hugetlb_pool
Copy to Clipboard Toggle word wrap
Alternatively, you can use sysctl(8) to change it:
# sysctl -w vm.hugetlb_pool=1024
Copy to Clipboard Toggle word wrap
To make the change permanent, add the following line to the file /etc/sysctl.conf. This file is used during the boot process. The Huge Pages pool is usually guaranteed if requested at boot time:
# echo "vm.hugetlb_pool=1024" >> /etc/sysctl.conf
Copy to Clipboard Toggle word wrap
If you allocate a large number of Huge Pages, the execution of the above commands can take a while. To verify whether the kernel was able to allocate the requested number of Huge Pages, execute:
$ grep HugePages_Total /proc/meminfo
HugePages_Total:   512 
$
Copy to Clipboard Toggle word wrap
The output shows that 512 Huge Pages have been allocated. Since the size of Huge Pages on this system is 2048 KB, a Huge Page pool of 1GB has been allocated and pinned in physical memory.
If HugePages_Total is lower than what was requested with hugetlb_pool, then the system does either not have enough memory or there are not enough physically contiguous free pages. In the latter case the system needs to be rebooted which should give you a better chance of getting the memory.
To get the number of free Huge Pages on the system, execute:
$ grep HugePages_Free /proc/meminfo
Copy to Clipboard Toggle word wrap
Free system memory will automatically be decreased by the size of the Huge Pages pool allocation regardless whether the pool is being used by an application like Oracle database or not being used:
$ grep MemFree /proc/meminfo
Copy to Clipboard Toggle word wrap
After an Oracle database starts up, verify the Huge Pages usage. The number of free Huge Pages should decrease.
$ grep HugePages_Free /proc/meminfo
Copy to Clipboard Toggle word wrap
To free the Huge Pages pool, you can execute:
# echo 0 > /proc/sys/vm/hugetlb_pool
Copy to Clipboard Toggle word wrap
This command usually takes a while to finish.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat