Reputation: 2835
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?
Upvotes: 0
Views: 1510
Reputation: 899
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
Upvotes: 1