For newer elasticsearch versions... I guess v5.0 and above... I see that we have jvm.options file. In that file we have the JVM flag
-XX:+AlwaysPreTouch set by default.
As I understand, this flag tells the OS to map the memory pages to the java process at the time of process initialization versus at incrementally at runtime.
As per the oracle page on jvm settings - http://www.oracle.com/technetwork/articles/java/vmoptions-jsp-140102.html, AlwaysPreTouch does the following:
Pre-touch the Java heap during JVM initialization. Every page of the heap is thus demand-zeroed during initialization rather than incrementally during application execution
My question is:
If this flag is already set during ES startup then why do we need to turn off swap in the OS?