# Negative free swap space size

**URL:** https://discuss.elastic.co/t/negative-free-swap-space-size/242626
**Category:** Elasticsearch
**Tags:** docker
**Created:** [July 26, 2020, 3:29am UTC](https://discuss.elastic.co/t/negative-free-swap-space-size/242626 "2020-07-26T03:29:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![teebu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teebu/32/10119_2.png) [@teebu](https://discuss.elastic.co/u/teebu)
#### Post date: [July 26, 2020, 3:29am UTC](https://discuss.elastic.co/t/negative-free-swap-space-size/242626/1 "2020-07-26T03:29:17Z")

</div>

I installed ES 7.8.0 to my local kubernetes cluster using the helm chart into my docker-for-windows and WSL2. I'm seeing this error message in my logs constantly.

```auto
{"type": "server", "timestamp": "2020-07-26T03:23:47,931Z", "level": "WARN", "component": "o.e.m.o.OsProbe", "cluster.name": "elasticsearch", "node.name": "elasticsearch-master-0", "message": "OS reported a negative free swap space size [-1331200]", "cluster.uuid": "VRfCMzqyRLe8OFpAMl949A", "node.id": "RL0hcyEiTIWmMLDZH3vdwQ" }
{"type": "server", "timestamp": "2020-07-26T03:23:57,931Z", "level": "WARN", "component": "o.e.m.o.OsProbe", "cluster.name": "elasticsearch", "node.name": "elasticsearch-master-0", "message": "OS reported a negative free swap space size [-1331200]", "cluster.uuid": "VRfCMzqyRLe8OFpAMl949A", "node.id": "RL0hcyEiTIWmMLDZH3vdwQ" }
{"type": "server", "timestamp": "2020-07-26T03:24:07,932Z", "level": "WARN", "component": "o.e.m.o.OsProbe", "cluster.name": "elasticsearch", "node.name": "elasticsearch-master-0", "message": "OS reported a negative free swap space size [-1331200]", "cluster.uuid": "VRfCMzqyRLe8OFpAMl949A", "node.id": "RL0hcyEiTIWmMLDZH3vdwQ" }

```

---

<div class="post-metadata">

### Author: ![greyhats13](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/greyhats13/32/72807_2.png) [@greyhats13](https://discuss.elastic.co/u/greyhats13)
#### Post date: [July 26, 2020, 3:07pm UTC](https://discuss.elastic.co/t/negative-free-swap-space-size/242626/2 "2020-07-26T15:07:36Z")

</div>

I had the same issue too. I installed ES 7.8.0 using Elastic Cloud Kubernetes. I implement this "sysctl -w vm.swappiness=1" and "swapoff " on init containers for disabling swap, because I had an issue if disabling swap using "bootstrap.memory\_lock: true". is it possible that my configuration below to disable swap might cause the negative free swap space?

```auto
initContainers:
            - name: sysctl
              command:
                - sh
                - '-c'
                - |
                  sysctl -w vm.max_map_count=262144
                  sysctl -w vm.swappiness=1
                  swapoff -a

```

---

<div class="post-metadata">

### Author: ![hoppy-kamper](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hoppy-kamper/32/36085_2.png) [@hoppy-kamper](https://discuss.elastic.co/u/hoppy-kamper)
#### Post date: [August 10, 2020, 3:46pm UTC](https://discuss.elastic.co/t/negative-free-swap-space-size/242626/3 "2020-08-10T15:46:14Z")

</div>

I also receive the WARN log `OS reported a negative free swap space size [-4096]` on a hosted Elastic Cloud deployment running 7.8.1.

The warning only comes from a single data node that is not unique from other data nodes in any way I can think of.

I submitted a ticket, will see what they follow up with.

---

<div class="post-metadata">

### Author: ![qclaogui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/qclaogui/32/62318_2.png) [@qclaogui](https://discuss.elastic.co/u/qclaogui)
#### Post date: [August 20, 2020, 3:45am UTC](https://discuss.elastic.co/t/negative-free-swap-space-size/242626/4 "2020-08-20T03:45:22Z")

</div>

I got this [https://github.com/elastic/elasticsearch/pull/60444](https://github.com/elastic/elasticsearch/pull/60444)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 17, 2020, 3:45am UTC](https://discuss.elastic.co/t/negative-free-swap-space-size/242626/5 "2020-09-17T03:45:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
