Security – How to reconcile the following error: “JVM cannot use large page memory because it does not have enough privilege to lock pages in memory”

javaSecurity

Please help!!! I wonder how can I reconcile the following error: "JVM cannot use large page memory because it does not have enough privilege to lock pages in memory"?

The settings are:
set JAVA_OPTS=-Xms20g -Xmx20g -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseLargePages -Duser.timezone="GMT" %DEBUG%

Best Answer

There is a page on Sun's website about this: http://java.sun.com/javase/technologies/hotspot/largememory.jsp

Here's the relevant information for what is likely your problem:

Only Windows Server 2003 supports large page memory. In order to use it, the administrator must first assign additional privilege to the user who will be running the application:

  1. select Control Panel -> Administrative Tools -> Local Security Policy
  2. select Local Policies -> User Rights Assignment
  3. double click "Lock pages in memory", add users and/or groups
  4. reboot the machine

Note the above steps are needed even if it's the administrator who will be running the application, as administrators by default do not have the privilege to lock pages in memory.