How do I enable large page support for Java?
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:
- How do I enable large page support on Linux?
- For RHEL 6, is also recommended to disable Transparent Huge Pages Do I need to configure hugepages for JBoss on RHEL 6 even though transparent hugepages in RHEL 6 are fully automatic?
- How do I enable large page support on Solaris?
- How do I enable large page support on Windows?
OpenJDK / Sun JDK
- Add the following JVM option:
-XX:+UseLargePages - Set the large page size. For example:
-XX:LargePageSizeInBytes=4mNote: 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
- Add the following JVM option:
-XXlargePages
SBR
Product(s)
Components
Category
Tags
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.