How do I enable large page support for Java?

Solution Verified - Updated

Environment

  • Sun JDK
  • OpenJDK
  • IBM JDK
  • JRockit JDK

Issue

  • How do I enable Java large page support?

Resolution

First, large pages must be enabled in the operating system:

OpenJDK / Sun JDK
  • Add the following JVM option:
    -XX:+UseLargePages
    
  • Set the large page size. For example:
    -XX:LargePageSizeInBytes=4m 
    

    Note: This option only has meaning on Solaris. On Linux, it is set to whatever page size is set in the kernel (Hugepagesize). On Windows it is fixed at 2 MB.

    If you try to use this option on Linux, you will get the following warning:
    OpenJDK 64-Bit Server VM warning: Setting LargePageSizeInBytes has no effect on this OS. Large page size is 2048K.

IBM JDK
  • Add the following JVM option:
    -Xlp
    
##### JRockit JDK
  • Add the following JVM option:
    -XXlargePages
    
SBR
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.