Yes, for "well behaved" systems, but sometimes they don't behave
What happens without swap when the system is critically low on memory? OOM Killer will usually kill the process that will free the most memory, which may be the elasticsearch process.
IMHO, having system swap available (see this) and setting bootstrap.memory_lock for elasticsearch may let your system recover from some low memory events without OOM Killer sacrificing some processes.
Moving unreferenced memory pages to swap disk IS cost effective. It's REFREENCING swapped pages that causes problems.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.