tags:

views:

141

answers:

2

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%

This happen on Windows 2003

+4  A: 

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.

Pascal Thivent
A: 

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

Roman Kagan
http://java.sun.com/javase/technologies/hotspot/largememory.jspOnly Windows Server 2003 supports that among the windows family. Solaris and Linux support them too.
Vinko Vrsalovic
how does Large Memory benefit a jvm? why is it important to lock a process into physical memory?
djangofan