Controlling Elastic memory inside docker

docker

(Tobias Eriksson) #1

I am running Elastic 6.2.3 in a Docker container
But do not understand how the RAM used by the process goes way beyond the limits set

Container is configured

"Memory": 34225520640,
"CpusetMems": "",
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 34225520640,
"MemorySwappiness": null,

Elastic JVM is configured

      ES_JAVA_OPTS=-Xms26112m -Xmx26112m

And then elasticsearch.yml is configured

     bootstrap.memory_lock: true
     indices.fielddata.cache.size: 50GB

When I do 'top' on the host/machine (linux)
I have seen Virtual Mem all the way up to 75 Gig

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
128908 elastic+ 20 0 68.1g 27.2g 651776 S 151.8 27.6 606:17.50 java

How can I

  1. Calculate the max memory Elastic is using
  2. Control / Set a max limit to ensure it does not steel memory from other processes I want to run on the same machine