# Jvm heap size continuous increase

**URL:** <https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987>\
**Category:** Elasticsearch\
**Created:** [February 8, 2018, 7:37am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987 "2018-02-08T07:37:05Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![junkainiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/junkainiu/32/23928_2.png) [@junkainiu](https://discuss.elastic.co/u/junkainiu)\
**Post date:** [February 8, 2018, 7:37am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/1 "2018-02-08T07:37:05Z")

</div>

Elasticsearch version (bin/elasticsearch --version):  
5.3.0  
Plugins installed:   
None  
JVM version (java -version):  
1.8.0\_66  
OS version (uname -a if on a Unix-like system):  
centos 7  
Linux localhost.localdomain 3.10.0-229.el7.x86\_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86\_64 x86\_64 x86\_64 GNU/Linux  
Description of the problem including expected versus actual behavior:

We are running a one node elaticsearch cluster with 32GB heap size . The heap size is continous increasing even if there are no any indexing and query, so what is increasing in the heap? Is it a bug or it's normal for jvm?  
see the img below from x-pack for detail jvm and index info.

 ![git1](https://us1.discourse-cdn.com/elastic/original/3X/6/8/68f4e976966fbed5f7b69390c1358020d2b6d776.png)  
 ![git2](https://us1.discourse-cdn.com/elastic/original/3X/d/d/dd8e95b47b655ed03f5e3c3aa96b771a7fcce27c.png)  
 ![git3](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f2ecfeff3c8dbeb737e92c771a8953d2a4f6302a.png)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 8, 2018, 7:58am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/2 "2018-02-08T07:58:50Z")

</div>

Nothing seems abnormal here. Why do you think so?

BTW, you are using x-pack (monitoring) so you have indexing happening on your cluster.  
Check `GET _cat/indices?v`.

Unless you set an external monitoring cluster (recommended).

---

<div class="post-metadata">

**Author:** ![junkainiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/junkainiu/32/23928_2.png) [@junkainiu](https://discuss.elastic.co/u/junkainiu)\
**Post date:** [February 8, 2018, 8:04am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/3 "2018-02-08T08:04:05Z")

</div>

Thanks for the quick reply. I am not sure why the heap size is still increasing after I stop indexing at about 20: 00. The heap size is still slowly increaing and dramaticly decline and slowly increasing. What makes this incease of the heap size?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 8, 2018, 8:24am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/4 "2018-02-08T08:24:42Z")

</div>

1. Is that a problem?
2. Did you check what I said? What is the output of it?

---

<div class="post-metadata">

**Author:** ![junkainiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/junkainiu/32/23928_2.png) [@junkainiu](https://discuss.elastic.co/u/junkainiu)\
**Post date:** [February 8, 2018, 8:31am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/5 "2018-02-08T08:31:28Z")

</div>

1. Yes, I am concerned about the jvm usage. I can not sleep if I can not find out the reason of the increase.

2. Yes, I checked. It shows lots of indices

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 8, 2018, 8:32am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/6 "2018-02-08T08:32:26Z")

</div>

Please don't post images of text as they are hardly readable and not searchable.

Instead paste the text and format it with `</>` icon. Check the preview window.

Could you edit your post and paste all the content please?

---

<div class="post-metadata">

**Author:** ![junkainiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/junkainiu/32/23928_2.png) [@junkainiu](https://discuss.elastic.co/u/junkainiu)\
**Post date:** [February 8, 2018, 8:46am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/7 "2018-02-08T08:46:05Z")

</div>

Can not paste all the content because it exceeds the max size...All indices are like what I posted before, and there are also indices from x-pack, like

```
yellow open .monitoring-es-2-2018.02.01 U6h5VN5qS2KE0uNczWKT0Q 1 1 2441813 3328 1015.9mb 1015.9mb
yellow open .monitoring-kibana-2-2018.02.03 VOOzRbp7RuKWcyr1nsHi9w 1 1 8638 0 2mb 2mb
yellow open .monitoring-es-2-2018.02.06 qhi947-MQAWT_Ue1xABHDw 1 1 11095304 8985 4gb 4gb
yellow open .monitoring-kibana-2-2018.02.01 2vK5kKxVQG6nAa-KXxTRUA 1 1 8637 0 2.1mb 2.1mb
yellow open .monitoring-es-2-2018.02.04 C0_VsXFMSECr3gQa2CFhkg 1 1 4320019 6077 1.6gb 1.6gb
yellow open .monitoring-es-2-2018.02.02 ieW7ZTgdSaWlwpAyk3iQjg 1 1 4140436 4856 1.6gb 1.6gb
yellow open .monitoring-kibana-2-2018.02.02 -pULU5BSRbSBF3QsL8YkMQ 1 1 8638 0 2.1mb 2.1mb
yellow open .monitoring-kibana-2-2018.02.07 aG0gHwK1S72p4fqfiJDs_g 1 1 8636 0 2.1mb 2.1mb
yellow open .monitoring-es-2-2018.02.05 tAZiEawSR3qtYpYzRgeU3A 1 1 4611399 12916 1.6gb 1.6gb
yellow open .monitoring-es-2-2018.02.08 uZcpzUCTQYKHn3Nym8OnUQ 1 1 4166667 20095 1.4gb 1.4gb
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 8, 2018, 9:13am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/8 "2018-02-08T09:13:51Z")

</div>

You can share as a gist on [gist.github.com](http://gist.github.com).

As you can see you have indexing operations happening all the time. So you can't say that you are not indexing anything.

As I said, having a dedicated monitoring cluster is better. BTW if you are a gold or platinum customer, this monitoring cluster is available for free on cloud.elastic.co.

All your "business" shards seem to be small (like less than 800mb). Is that on purpose?  
How did you determine this `3000000` documents limit per shard?

How many shards you have in total?

---

<div class="post-metadata">

**Author:** ![junkainiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/junkainiu/32/23928_2.png) [@junkainiu](https://discuss.elastic.co/u/junkainiu)\
**Post date:** [February 8, 2018, 9:24am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/9 "2018-02-08T09:24:37Z")

</div>

Hi, I have 1458 indices, [https://gist.github.com/junkainiu/e6a3f7e32fa9b25f7bead9ca81d1fd8f](https://gist.github.com/junkainiu/e6a3f7e32fa9b25f7bead9ca81d1fd8f)

 ![git1](https://us1.discourse-cdn.com/elastic/original/3X/6/8/68f4e976966fbed5f7b69390c1358020d2b6d776.png)

That means the heap size increase is caused by the monitoring indices?  
The document limit is set purposely for testing the jvm usage for the same total data size of elasticsearch node with different number of indices

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 8, 2018, 9:50am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/10 "2018-02-08T09:50:21Z")

</div>

May be. And probably by an ever growing cluster state.

May I suggest you look at the following resources about sizing:

[https://www.elastic.co/elasticon/conf/2016/sf/quantitative-cluster-sizing](https://www.elastic.co/elasticon/conf/2016/sf/quantitative-cluster-sizing)

> **[How many shards should I have in my Elasticsearch cluster?
	  	 | Elastic](https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster)**
>
> Elasticsearch is a very versatile platform, that supports a variety of use cases, and provides great flexibility around data organisation and replication strategies. This flexibility can however somet...

> **[NetSecureDay: Managing your Black Friday Logs](https://speakerdeck.com/elastic/netsecureday-managing-your-black-friday-logs)**
>
> Surveiller une application complexe n’est pas une tâche aisée, mais avec les bons outils, ce n’est pas si sorcier. Néanmoins, des périodes fortes telles que les opérations de type « Black Friday » (Vendredi noir) ou période de Noël peuvent pousser...

---

<div class="post-metadata">

**Author:** ![junkainiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/junkainiu/32/23928_2.png) [@junkainiu](https://discuss.elastic.co/u/junkainiu)\
**Post date:** [February 8, 2018, 10:49am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/11 "2018-02-08T10:49:33Z")

</div>

Thanks for the resources.. I understand 1000+ indices is too many and 800MB per shard is too low for a 32GB size heap. A better architecture should be applied. I will try a dedicated monitoring cluster and try to find more information about the problem. Thanks.

---

<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:** [March 8, 2018, 10:49am UTC](https://discuss.elastic.co/t/jvm-heap-size-continuous-increase/118987/12 "2018-03-08T10:49:41Z")

</div>

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