Memory Iissue with Docker
I’m using Alpine Linux on a Xeon server with (24G RAM and 12 cores) to act as a dedicated Docker host. I followed the instructions from https://wiki.alpinelinux.org/wiki/Docker and it works on some containers but most of them exit with a memory related error message.
root@green #~ uname -a
Linux green 4.9.32-0-hardened #1-Alpine SMP Fri Jun 16 12:20:58 GMT 2017 x86_64 Linux
root@green #~ docker version
Client:
Version: 17.05.0-ce
API version: 1.29
Go version: go1.8.1
Git commit: v17.05.0-ce
Built: Tue May 16 10:10:04 2017
OS/Arch: linux/amd64
Server:
Version: 17.05.0-ce
API version: 1.29 (minimum version 1.12)
Go version: go1.8.1
Git commit: v17.05.0-ce
Built: Tue May 16 10:10:04 2017
OS/Arch: linux/amd64
Experimental: false
Example container:
docker run --name db -d mongo:3.0 --smallfiles
root@green #~ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5ba7f845e982 mongo:3.0 "docker-entrypoint..." About an hour ago Exited (137) 6 seconds ago
The container stops with code 137 (out of memory). When this happens the server still has over 21g of free RAM.
When starting a java based container I also get the out of memory error:
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000767ac8f75000, 2555904, 1) failed; error='Operation not permitted' (errno=1)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 2555904 bytes for committing reserved memory.
This also happens when I use the docker parameter for container specific memory, no matter how much I give it.
I have also tested the RAM itself via the BIOS and via the “eatmemory” command. Seems fine.
Has anyone experienced this problem before?
(from redmine: issue id 7778, created on 2017-08-30)