I am trying to run a java application inside a docker container, with -Xms4g and -Xmx4g. Ideally when the JVM starts it should have 4G heap pre-allocated.
But when i start the container, I see something like this with docker stats:
CONTAINER CPU % MEM USAGE / LIMIT
xyz 73.91% 1.756 GB / 8.203 GB
I have not applied any memory limit to the container. Still the memory used is coming to less than 2GB? I have verified this with top command as well. Also, the Java that I am using is 64-Bit
Is there any docker run option where i can pre-allocate memory?