﻿---
title: Memory lock disabled
description: Describes what AutoOps detects and surfaces with the Memory lock disabled insight: Memory locking is turned off (`bootstrap.memory_lock: false`), so the JVM heap is not locked in RAM.
url: https://www.elastic.co/docs/reference/autoops-insights/elasticsearch/memory_lock_disabled
products:
  - Elastic Cloud Enterprise
  - Elastic Cloud on Kubernetes
  - Elasticsearch
applies_to:
  - Elastic Cloud on Kubernetes: Generally available
  - Elastic Cloud Enterprise: Generally available
  - Self-managed Elastic deployments: Generally available
---

# Memory lock disabled
Memory locking is turned off (`bootstrap.memory_lock: false`), so the JVM heap is not locked in RAM. If the host swaps heap pages to disk, latency and garbage collection can degrade sharply.
<note>
  For a complete list of insights, refer to [AutoOps insights](https://www.elastic.co/docs/reference/autoops-insights/elasticsearch).
</note>


## Insight details


| Field     | Value                          |
|-----------|--------------------------------|
| Component | Elasticsearch                  |
| Severity  | Medium                         |
| Scope     | Node                           |
| Domains   | performance, memory, stability |


## Example: What you might see in AutoOps

The following is an example of what you might see when this insight is triggered. Real insights use live data and links from your deployment or cluster.

### Memory lock is turned off


#### What was detected

`bootstrap.memory_lock` is `false` in the cluster settings. The JVM heap is not locked in RAM.

#### Recommendations

<note>
  AutoOps shows different recommendations depending on how their conditions match your deployment or cluster.
</note>

<dropdown title="Enable memory lock on nodes">
  **Condition**: Always shown for this insight.As a last resort if OS-level memory locking is not enough, set `bootstrap.memory_lock: true` in `elasticsearch.yml` on each affected node, then perform a rolling restart. This keeps the JVM heap from being swapped out.
</dropdown>

<dropdown title="Enable OS memory lock">
  **Condition**: Always shown for this insight.Turn off memory swap so Elasticsearch can lock heap in RAM. On Linux, comment out swap entries in `/and so on/fstab`, or set `vm.swappiness` to `1`. On Windows, turn off the paging file under System Properties → Advanced → Performance → Advanced → Virtual memory.
</dropdown>


#### Background and impact

Elasticsearch performance depends on keeping the JVM heap in physical memory. If the operating system swaps heap pages to disk, search and indexing latency spike and garbage collection can stall the node.
Setting `bootstrap.memory_lock` to true asks Elasticsearch to lock the JVM heap in RAM. The host must also allow the lock (for example, `memlock` limits). The memory-lock bootstrap check fails when `bootstrap.memory_lock` is true and the JVM could not lock the heap, not because swap is still enabled. Disabling swap at the operating system level is an alternative to memory locking.
Until memory lock is enabled or swap is turned off, the node remains exposed to swap-related latency and instability under memory pressure.