Possibility to limit memory usage of MMap FS?


(Rupert Meindl) #1

ES is using hybrid MMap/NIO FS as default. Downside of this setup is that on our nodes ES (1.5.2) only leaves ~300 MB free for the operating system (Ubuntu 14.04.2) ... is there a way to limit the Off-Heap memory footprint used by Lucene or is the only way to control it re-indexing to pure NIO FS (hard, because large index but possible because SSDs used for storage). I have also not found what percentage of memory MMap leaves unused ... always around 300-350 MB which sometimes is causing troubles for the OS ...


(Jörg Prante) #2

Use -XX:MaxDirectMemorySize JVM directive with a limit to trigger garbage collection on off-heap memory.

https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

Note, please check elasticsearch.in.sh to remove/comment the line

JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC"

since -XX:+DisableExplicitGC avoids any garbage collection calls to release off-heap memory.


(Rupert Meindl) #3

Thanks, will try it. ES_DIRECT_SIZE I have found too, the -XX:+DisableExplicitGC I would have overlooked.


(system) #4