# Kibana HEAP Allocation in k8s/docker

**URL:** https://discuss.elastic.co/t/kibana-heap-allocation-in-k8s-docker/221860
**Category:** Kibana
**Created:** [March 3, 2020, 10:52am UTC](https://discuss.elastic.co/t/kibana-heap-allocation-in-k8s-docker/221860 "2020-03-03T10:52:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)
#### Post date: [March 3, 2020, 10:52am UTC](https://discuss.elastic.co/t/kibana-heap-allocation-in-k8s-docker/221860/1 "2020-03-03T10:52:09Z")

</div>

Hi,  
I am running kibana in k8s with requests/limits set for cpu & ram. Upper memory limit is 2GB. I'm seeing periodic out of memory errors and am going to raise the upper container limit.

Given that I have been seeing out of heap errors how do I set the max heap so that it matches the container memory limit?

Thx  
D

---

<div class="post-metadata">

### Author: ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)
#### Post date: [March 3, 2020, 1:22pm UTC](https://discuss.elastic.co/t/kibana-heap-allocation-in-k8s-docker/221860/2 "2020-03-03T13:22:58Z")

</div>

Hi dawiro

Thanks for reaching out to us. Kibana is running on node.js, we don't recommend to change it's memory settings, I'll ask for you what's a recommended minimum memory spec for Kibana  
Best,  
Matthias

---

<div class="post-metadata">

### Author: ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)
#### Post date: [March 3, 2020, 3:59pm UTC](https://discuss.elastic.co/t/kibana-heap-allocation-in-k8s-docker/221860/3 "2020-03-03T15:59:08Z")

</div>

I've asked our operations team, 2GB is usually a good value, you should define the memory in the following way:

NODE\_OPTIONS=--max\_old\_space\_size=2048

Best,  
Matthias

---

<div class="post-metadata">

### Author: ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)
#### Post date: [March 4, 2020, 9:24am UTC](https://discuss.elastic.co/t/kibana-heap-allocation-in-k8s-docker/221860/4 "2020-03-04T09:24:09Z")

</div>

Does this mean that the guidance to not explicitly set memory options no longer applies? Users are going to become confused...

Thx  
D

---

<div class="post-metadata">

### Author: ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)
#### Post date: [March 4, 2020, 11:31am UTC](https://discuss.elastic.co/t/kibana-heap-allocation-in-k8s-docker/221860/5 "2020-03-04T11:31:52Z")

</div>

Yes, you can do that in container context!

---

<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: [April 1, 2020, 11:32am UTC](https://discuss.elastic.co/t/kibana-heap-allocation-in-k8s-docker/221860/6 "2020-04-01T11:32:02Z")

</div>

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