0
votes

I have some issues understanding how a Docker Java container uses memory for the host machine. I gave the container JVM opt

"JAVA_OPTS=-XX:MaxMetaspaceSize=1024m -Xms=512m -Xmx=1024m -XX:PermSize=512m -XX:MaxPermSize=1024m "

But when I'm running Docker stats on the container I see that MEM USAGE is 1.6GB

Is docker allocating memory for the none of JVM parts of the container?

Do you usually limit the container memory limit?

1

1 Answers

1
votes

That's all the memory of the docker container (OS + JVM) including the operating system. And yes you can put some limit to the memory check:

https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources