How do I enable large page support on Windows?
Environment
- Windows
- Java JDK
Issue
- I want to enable large page support for Java, and I must enable it on my Windows system.
- Unable to start JBoss and getting below logs:
Java HotSpot(TM) 64-Bit Server VM warning: JVM cannot use large page memory because it does not have enough privilege to lock pages in memory.
java.lang.NoClassDefFoundError: 922
Caused by: java.lang.ClassNotFoundException: 922
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: 922. Program will exit.
Exception in thread "main" Shutdown JBoss EAP 5 (JVM1) service
Resolution
-
Large pages are only supported on Windows Server 2003/2008.
-
The user running Java must have the following additional privileges assigned:
- Select Control Panel -> Administrative Tools -> Local Security Policy
- Select Local Policies -> User Rights Assignment
- Double click "Lock pages in memory"
- Add users and/or groups
- Reboot the machine
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.