Elasticsearch (i.e. Lucene) relies on the OS page cache to keep a copy of the on-disk index data in RAM if possible. It sounds like your operating system is paging that data out because it needs the RAM for other purposes.
mlockall is about swapping, which is basically the opposite process.