JVM cant map reserved memory when running in Docker container JVM cant map reserved memory when running in Docker container docker docker

JVM cant map reserved memory when running in Docker container


I had this same problem when using a Grsec enabled kernel. For java to play nice, I had to disable MPROTECT on the java binary. You can use the paxctl utility for this:

paxctl -m /usr/lib/jvm/java-7-openjdk/jre/bin/java

You'll need to do paxctl -c on the binary first if you've never used it on that binary before:

paxctl -c /usr/lib/jvm/java-7-openjdk/jre/bin/java

More information about paxctl can be found at: http://en.wikibooks.org/wiki/Grsecurity/Additional_Utilities


I had the same problem when running Docker on Alpine Linux, after enabling PaX soft mode it worked:

sysctl -w kernel.pax.softmode=1

Soft mode will disable most PaX features by default, therefore it is not recommended to enable it. The proper way is to use paxctl, as already mentioned above.

Also have a look here:https://en.wikibooks.org/wiki/Grsecurity/Appendix/Grsecurity_and_PaX_Configuration_Options#Support_soft_mode


This happened to me as well ,We reduced the RAM size on our VM and after a couple of days started getting this error and service did not came up for ever.

Solution :: We reduced the heap size of the application or service having this issue and the service came up fine again.