JVM cant map reserved memory when running in Docker container

后端 未结 3 1743
南方客
南方客 2020-12-30 08:26

I cant seem to run java at all in a Docker container on my server. Even when issuing java -version, I get the following error.

root@86088d67910         


        
相关标签:
3条回答
  • 2020-12-30 08:56

    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

    0 讨论(0)
  • 2020-12-30 09:01

    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.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题