logger.info("mlockall() on JVM Heap successful");
} catch(Exception e) {
if(!(e instanceof LastErrorException))
logger.error("Unexpected error during mlock of server heap", e);
LastErrorException le = (LastErrorException) e;
if(le.getErrorCode() == ENOMEM && isOperatingSystem("linux")) {
logger.warn("Unable to lock JVM memory (ENOMEM)."
+ " This can result in part of the JVM being swapped out with higher Young gen stalls"
+ " Increase RLIMIT_MEMLOCK or run Voldemort as root.");
} else if(!isOperatingSystem("mac")) {
// fixes a OS X oddity, where it still throws an error, even
// though mlockall succeeds
logger.warn("Unknown mlockall error " + le.getErrorCode());
}
}
}