Do I need to configure hugepages for JBoss on RHEL 6 even though transparent hugepages in RHEL 6 are fully automatic?

Solution Verified - Updated

Environment

  • JBoss Enterprise SOA Platform
  • JBoss Enterprise Application Platform (EAP)
  • Red Hat Enterprise Linux (RHEL) 6

Issue

  • I found an article about HugePages on RHEL 6. Setup is different from RHEL 5
    Transparent hugepages in RHEL 6 is a fully automatic thing. Do I still need to configure all these parameters, and add "UseLargePages" option to JBoss?
  • What is the procedure to enable it on RHEL 6?

Resolution

Though Transparent Huge Pages (THP) are enabled by default in RHEL, one potential downside of using THPs is that there is no guarantee the kernel will decide to use them. Only that it probably will. Configuring it as you would on RHEL 5 is to guarantee that JBoss is using huge pages.

  • To use THP, remove the JVM options -XX:LargePageSizeInBytes -XX:+UseLargePages otherwise it will fail because the JVM will ask the OS for large pages where none was configured.

  • If you want to still statically configure large pages with your JVM (preferred), then you should turn off transparent huge pages, which you can do:

Example for the grub option:

title Red Hat Enterprise Linux (2.6.32-220.el6.x86_64)
        root (hd0,0)
kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=UUID=f8196a3a-1f1a-47f3-9141-1d33e3da4454 
rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb 
crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM transparent_hugepage=never
        initrd /initramfs-2.6.32-220.el6.x86_64.img
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.