# Can i set vm.max\_map\_count at creation?

**URL:** <https://discuss.elastic.co/t/can-i-set-vm-max-map-count-at-creation/105456>\
**Category:** Elasticsearch\
**Created:** [October 26, 2017, 4:48pm UTC](https://discuss.elastic.co/t/can-i-set-vm-max-map-count-at-creation/105456 "2017-10-26T16:48:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DStorck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dstorck/32/33811_2.png) [@DStorck](https://discuss.elastic.co/u/DStorck)\
**Post date:** [October 26, 2017, 4:48pm UTC](https://discuss.elastic.co/t/can-i-set-vm-max-map-count-at-creation/105456/1 "2017-10-26T16:48:37Z")

</div>

I am getting this error: `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` The research I've done shows that once elasticsearch is running, I could go in and raise the limit by using `sysctl -w vm.max_map_count=262144`. This isn't great for my setup though since I am trying to wrap everything up in a helm chart and want to be able to fire it up and have all the configurations set in advance. Is there anywhere I ca place this setting so that when elasticsearch starts, it has the correct vm setting?

---

<div class="post-metadata">

**Author:** ![DStorck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dstorck/32/33811_2.png) [@DStorck](https://discuss.elastic.co/u/DStorck)\
**Post date:** [November 3, 2017, 1:38am UTC](https://discuss.elastic.co/t/can-i-set-vm-max-map-count-at-creation/105456/2 "2017-11-03T01:38:15Z")

</div>

we solved this with an init container:

```auto
      initContainers:
      - name: sysctl
         image: busybox
         imagePullPolicy: IfNotPresent
         command: ["sysctl", "-w", "vm.max_map_count=262144"]
         securityContext: {"privileged": true}

```

---

<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:** [December 1, 2017, 1:38am UTC](https://discuss.elastic.co/t/can-i-set-vm-max-map-count-at-creation/105456/3 "2017-12-01T01:38:23Z")

</div>

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