cancel
Showing results for 
Search instead for 
Did you mean: 

Addressing "Failed to reserve shared memory" errors

UnboundID PedroT
0 Kudos

Sometime errors like this will appear in server.out:
VM warning: Failed to reserve shared memory (errno = XX).

Having huge pages enabled on the OS can cause significant performance issues if incorrectly configured or configured in an inconsistent manner with respects to the JVM.

A general guide on how to properly configure the host system is available here:

http://www.oracle.com/technetwork/java/javase/tech/largememory-jsp-137182.html


(errno = 1)
Errno 1 is permission denied. On CentOS 6.x this is usually resolved by adding the Group ID (GID) of the server to /proc/sys/vm/hugetlb_shm_group. In your case the server runs as user dsuser and group dsuser.

echo <numeric_gid_of_dsuser> > /proc/sys/vm/hugetlb_shm_group

(errno = 12)
This indicates a conflict with limits.conf. To resolve this conflict, add these 2 lines in /etc/security/limits.conf:
* soft memlock unlimited
* hard hemlock unlimited

(errno = 22)
There is not enough huge pages available, or you do not have permission to access them.

Remember to give the user access to call the memlock system calls in /etc/security/limits.conf


After you have resolved any of these issues...
Restart DS and you should not see any JDK VM warnings in server.out and large page support will be enabled. This is unlikely the root cause but it will provide performance improvements seen when using LargePages.