File System cache under Docker for Elasticsearch containers

I’m running Elasticsearch container. One of the Elastic configurations suggest to limit the size of the Elasticsearch JVM to no more than 50% of physical memory. This is in order to leave enough RAM for Lucene and the Filesystem cache (
How should I treat this rule when running under Docker? What will happen in the container, is it using Filesystem cache inside the container, or is it utilizing the host?
If I limit the container RAM should it be enough?

Or eventually, with respect to this:
What is the best approach to configure my container RAM and JVM settings?


@doronbl Hi. I have the same question. How did you resolve this?

@bpwalsh Sorry for the late response.
As I didn’t get any help from the community regarding my question, we decided to do what we thought is best:

  1. Give our Elastic instance all memory he needs. Make sure ES service does not get more than half of the host RAM
  2. Disable swapping on the host itself to avoid swapping the ES container RAM to disk