JVM cannot use large page memory because it does not have enough privilege to lock pages in memory
Asked Answered
G

3

9

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%

This happened on Windows Server 2003.

Grabble answered 23/10, 2009 at 20:27 Comment(1)
This is happening on Windows 2003Bronchial
B
1

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

Bronchial answered 23/10, 2009 at 20:27 Comment(2)
java.sun.com/javase/technologies/hotspot/largememory.jsp Only Windows Server 2003 supports that among the windows family. Solaris and Linux support them too.Skolnik
how does Large Memory benefit a jvm? why is it important to lock a process into physical memory?Wedekind
H
8

Googling on the error leads to the hotspot/src/os/win32/vm/os_win32.cpp source file in openjdk-6 wich contains the following comment:

// Windows large page support is available on Windows 2003. In order to use
// large page memory, the administrator must first assign additional privilege
// to the user:
//   + 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
// Note the above steps are needed for administrator as well, as administrators
// by default do not have the privilege to lock pages in memory.
//
// Note about Windows 2003: although the API supports committing large page
// memory on a page-by-page basis and VirtualAlloc() returns success under this
// scenario, I found through experiment it only uses large page if the entire
// memory region is reserved and committed in a single VirtualAlloc() call.
// This makes Windows large page support more or less like Solaris ISM, in
// that the entire heap must be committed upfront. This probably will change
// in the future, if so the code below needs to be revisited.

If you're using Windows 2003, this might help. If not, I don't have any other suggestion.

Hickie answered 23/10, 2009 at 20:37 Comment(1)
learn.microsoft.com/en-us/sql/database-engine/configure-windows/… - Applies to Windows Server 2016 and Windows 10 (uses gpedit.msc)Erdda
S
2

I faced that only set configurations below is not enough:

Windows large page support is available on Windows 2003. In order to use
large page memory, the administrator must first assign additional privilege
to the user:

  • 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

Note the above steps are needed for administrator as well, as administrators
by default do not have the privilege to lock pages in memory.

The program who will call the java interpreter (java program.java) must be called with administrative rulles. Example: Eclipse, Netbeans, cmd, etc. In Windows made after 2003, you need do settings above, and after you can click with right button to open menu and choose "run as admnistrator" on the icon or executable caller program.

Stellarator answered 23/10, 2009 at 20:27 Comment(0)
B
1

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

Bronchial answered 23/10, 2009 at 20:27 Comment(2)
java.sun.com/javase/technologies/hotspot/largememory.jsp Only Windows Server 2003 supports that among the windows family. Solaris and Linux support them too.Skolnik
how does Large Memory benefit a jvm? why is it important to lock a process into physical memory?Wedekind

© 2022 - 2024 — McMap. All rights reserved.