﻿---
title: Increase virtual memory
description: Elasticsearch uses a mmapfs directory by default to store its indices, which relies on memory-mapped files. As a result, the default operating system...
url: https://www.elastic.co/elastic/docs-builder/docs/3016/deploy-manage/deploy/self-managed/vm-max-map-count
products:
  - Elasticsearch
applies_to:
  - Self-managed Elastic deployments: Generally available
---

# Increase virtual memory
Elasticsearch uses a [`mmapfs`](https://docs-v3-preview.elastic.dev/elastic/docs-builder/docs/3016/reference/elasticsearch/index-settings/store#mmapfs) directory by default to store its indices, which relies on memory-mapped files. As a result, the default operating system limit for the maximum number of memory mappings per process (`vm.max_map_count`) must be adequately high. If this limit is too low, the node might fail to start or encounter out-of-memory errors.
<admonition title="Verify vm.max_map_count configuration">
  If the operating system's default `vm.max_map_count` value is `1048576` or higher, no configuration change is necessary. If the default value is lower than `1048576`, configure the `vm.max_map_count` parameter to `1048576`.
</admonition>

On Linux, you can increase the limits of the `vm.max_map_count` parameter by following this step as an account with `root` privileges:
```sh
sysctl -w vm.max_map_count=1048576
```

To set this value permanently, update the `vm.max_map_count` setting in `/etc/sysctl.conf`.
To verify after rebooting, run:
```sh
sysctl vm.max_map_count
```

To reflect the change immediately, without rebooting, run:
```sh
sudo sysctl --system
```

While RPM and Debian packages attempt to configure this automatically, setting the value in `/etc/sysctl.conf` ensures that it takes precedence and that the correct value is applied, overriding any package-level defaults.
You can find out the current mmap count of a running Elasticsearch process using the following command, where `$PID` is the process ID of the running Elasticsearch process:
```sh
wc -l /proc/$PID/maps
```