We’ve started having problems with cassandra and memory swapping on linux which seems to be a fairly common issue (in our particular case after about a week all swap space will have been used up and we have to restart the process).


It sounds like the general consensus is to just disable swap completely, but the recently released “Cassandra High Performance Cookbook” from Packt has instructions for “Stopping cassandra from using swap without disabling it system wide”. We’ve tried following the instructions but it refers to a “memory_locking_policy” variable in cassandra.yaml which throws an “unknown property” error on startup and I can’t find any reference to it in any of the cassandra docs.


I’ve copied the summarised instructions below, does anyone know if this is something that ever worked or is there a different variable to set which does the same thing?

If you are having trouble preventing the swapping the other parameter that can help is disk_access_mode
We are using "mmap_index_only" and that has prevented swapping for now.

"auto" will try to use mmap for all disk access , 
"mmap" will use mmap
"standard" will not use mmap
Search for swapping on the users list and go through the email discussions and jira issues related to swapping and that will give you an idea what can work for you.