# Check Kibana max-old-space-size

**URL:** https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310
**Category:** Kibana
**Created:** [August 17, 2020, 7:35pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310 "2020-08-17T19:35:26Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![VeeT](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@VeeT](https://discuss.elastic.co/u/VeeT)
#### Post date: [August 17, 2020, 7:35pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310/1 "2020-08-17T19:35:26Z")

</div>

Hi,  
I tried adding --max-old-space-size=2048 into the bin/kibana file under NODE\_OPTIONS. How do I check that this came in effect?

Thanks!

---

<div class="post-metadata">

### Author: ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)
#### Post date: [August 17, 2020, 9:26pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310/2 "2020-08-17T21:26:31Z")

</div>

Hi there!

You should only need to set this if you are experiencing problems with exhausting memory, which is only common when changing the enabled plugins (either disabling any of the built-ins or installing custom ones). After setting this, are you still seeing issues? If so what is the error message and what version of Kibana are you using?

---

<div class="post-metadata">

### Author: ![VeeT](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@VeeT](https://discuss.elastic.co/u/VeeT)
#### Post date: [August 17, 2020, 9:50pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310/3 "2020-08-17T21:50:34Z")

</div>

Josh,  
Yes, we were getting the Java Heap error ("FATAL ERROR: CALL\_AND\_RETRY\_LAST Allocation failed - JavaScript heap out of memory"). I was researching for possible solution that's why I added the "max-old-space-size=2048" into the NODE\_OPTIONS.

I just want to know if there's a way to check the max-old-space-size. I have not seen the error but the night is young.

We are using Kibana 7.6.

Thanks!  
Vee

---

<div class="post-metadata">

### Author: ![VeeT](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@VeeT](https://discuss.elastic.co/u/VeeT)
#### Post date: [August 17, 2020, 10:46pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310/4 "2020-08-17T22:46:17Z")

</div>

Hi,  
I just saw the error again:

\<--- JS stacktrace ---\>

==== JS stack trace =========================================

```
0: ExitFrame [pc: 0x769a75878a1]

```

Security context: 0x068ee341e6e9   
1: byteLength [0x1d8e5c8f96a9] [buffer.js:~509] [pc=0x769a8eb23f7](this=0x1d8e5c8d31f1 \<JSFunction Buffer (sfi = 0x3bd8d6d96039)\>,string=0x23a6fdfd3c71 \<Very long string[384638914]\>,encoding=0x068ee343ddd1 \<String[4]: utf8\>)  
2: size [0x1ab23cd1c1e1] [/kibana/kibana-7.6.0-linux-x86\_64/node\_modules/hapi/lib/response.js:682] [bytecode=0x188f...

FATAL ERROR: CALL\_AND\_RETRY\_LAST Allocation failed - JavaScript heap out of memory

......  
......

This occurred after adding the max-old-space-size=2048 to bin/kibana.

Anyone has another suggestion?

Thanks!  
Vee

---

<div class="post-metadata">

### Author: ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)
#### Post date: [August 17, 2020, 11:07pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310/5 "2020-08-17T23:07:17Z")

</div>

I'm not aware of any way to verify the setting is being picked up. This setting is passed from Node.js into V8 (the JavaScript engine) directly, so there may be a way get this information out via V8's debugging API.

That said, I would try increasing this limit until you see the problem go away. If that doesn't work then it's not being set correctly. You can also set it when you execute Kibana:

```auto
NODE_OPTIONS="--max-old-space-size=4096" ./bin/kibana

```

Is there anything that seems to trigger this failure? For example, does this always happen on startup or when using a particular feature? It's possible you've encountered a bug in a feature that is creating very large amounts of memory usage that cannot be fixed by increasing this limit.

---

<div class="post-metadata">

### Author: ![VeeT](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@VeeT](https://discuss.elastic.co/u/VeeT)
#### Post date: [August 18, 2020, 2:40pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310/6 "2020-08-18T14:40:12Z")

</div>

Josh,  
Thanks. I will try adding it on the command line..

It seems like this failure is triggered when a query is run that returns a big result. It's hard to troubleshoot given the limited error log we see.

-Vee

---

<div class="post-metadata">

### Author: ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)
#### Post date: [August 19, 2020, 4:03pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310/7 "2020-08-19T16:03:48Z")

</div>

If a specific query is triggering the problem, you may want to try upgrading the Stack. We have fixed issues like this in the past and it's possible there is a bug fix for your specific issue. Do you know where these queries are originating from (Discover, Dashboard, Canvas, etc.)?

---

<div class="post-metadata">

### Author: ![VeeT](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@VeeT](https://discuss.elastic.co/u/VeeT)
#### Post date: [September 11, 2020, 8:25pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310/8 "2020-09-11T20:25:49Z")

</div>

Josh,  
I'm still trying to figure out where the query is being executed from. Is there a way to tell where it's coming from?

Thanks!  
Vee

---

<div class="post-metadata">

### Author: ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)
#### Post date: [September 14, 2020, 11:32pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310/9 "2020-09-14T23:32:23Z")

</div>

Your best be is turn on query logging by adding these to your kibana.yml file and restarting Kibana:

```auto
elasticsearch.logQueries: true
logging.verbose: true

```

You then should be able to see which query happens just before Kibana crashes. I hope that is helpful!

---

<div class="post-metadata">

### Author: ![VeeT](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@VeeT](https://discuss.elastic.co/u/VeeT)
#### Post date: [September 15, 2020, 2:45pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310/10 "2020-09-15T14:45:13Z")

</div>

Will try this. Thanks Josh!

---

<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: [October 13, 2020, 2:45pm UTC](https://discuss.elastic.co/t/check-kibana-max-old-space-size/245310/11 "2020-10-13T14:45:23Z")

</div>

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