Elastic search container Out of Memory


I created a new container based on elasticsearch and it worked fine but after a few minutes it seems that the container is limited on memory usage, got out of memory message on logs.

How can i specify memory to use for a specifi container ?

System : Red Hat Enterprise Linux Server release 7.4 (Maipo)
Docker version : Docker version 17.09.0-ce

Thank you

see the Runtime constraints on resources section of

check if you set the heap size for elasticsearch. The container’s max memory should be higher than the elasticsearch heap size.


I didn’t specify any option to limit the memory usage, concerning the heap size, how can i define this inside the container ?

If you didn’t specify any option to limit the memory usage, then it is probably elasticsearch use out of the heap.
See elasticsearch heap size. By default, the heap size is 1GB. When you login to the container, you should be under /usr/share/elasticssearch, the jvm config file is /usr/share/elasticsearch/config/jvm.options.
You could set the env variable when starting the container, ES_JAVA_OPTS="-Xms2g -Xmx2g". See install elasticsearch with docker


Yes the error message on the logs concern heap memory limit, so it should fix the problem !

thank you :slight_smile: