Heap Space issue on OpenDistro 1.7.0 with docker

Hi all,

I’m getting a quite annoying and blocking issue on docker with:

opendistro-for-elasticsearch:1.7.0

Basically, I’m still configuring elasticsearch stack for a TEST environment, but I reached the point I need to increase the heap space.
I tried from docker compose with env variable:

ES_JAVA_OPTS: ‘-Xms2g -Xmx2g’

and from jvm.options file:

-Xms2g
-Xmx2g

It works until 1g, but it crashes from 2g and more.
It doesn’t give me any error in the container logs, but after a while the container crashes and swarm tries to create a new container (with similar ending…) and so on.

Is there anything I’m missing in the configuration? The machine has plenty of RAM (24GB) and I don’t understand what can be the problem.

Here some specs:

docker server: 19.03.12
docker swarm mode

image: amazon/opendistro-for-elasticsearch:1.7.0
I’m using my own self signed certificates for open distro

machine: CentOS Linux 7
24GB ram
2 CPUs

Thanks,