Java – JRE in docker is out of memory

I'm trying to build and SBT 0.13 13 dock image similar to @ L_ 403_ 0 @ one Run Java $Java_ OPTS -jar sbt-launch. Jar (as a step to build the image) failed:

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000d3026000,451256320,0) Failed; error='Out of memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) Failed to map 451256320 bytes for committing 
reserved memory.

Adding - Xmx does not help What can I do to solve this problem? This is dockerfile: https://github.com/kolov/k8s-stuff/blob/master/scala/Dockerfile

Solution

Use the following command to increase the swap space on your hard disk

sudo dd if=/dev/zero of=/var/myswap bs=1M count=2048

sudo mkswap /var/myswap

sudo swapon /var/myswap
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>