Docker Community Forums

Share and learn in the Docker community.

Docker Container memory consumption

Expected behavior

We have a Java application that runs inside a Container, which is hosted in an EC2 instance. The EC2 instance runs multiple containers. We use MEM_LIMIT of 10GB with a MEM_RESERVE of 6GB per container and pass the reserved value to the JVM using -Xmx and -Xms.

Actual behavior

Java VM is creating 64Mbyte GUARD Page Blocks. They are essentially free - they just show up as large amount of memory being consumed - but kernel will never ever allocate memory for these guard blocks because the process does not even have “read” rights to these pages.

Eventually, the container crashes due to running out of memory or sometimes the kernel kills all the containers on the EC2 instance and restarts.

Additional Information

Steps to reproduce the behavior