# GC Settings for Elasticsearch

**URL:** <https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521>\
**Category:** Elasticsearch\
**Created:** [June 29, 2015, 7:11am UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521 "2015-06-29T07:11:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_\_Rennecke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael__rennecke/32/3484_2.png) [@Michael\_\_Rennecke](https://discuss.elastic.co/u/Michael__Rennecke)\
**Post date:** [June 29, 2015, 7:11am UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521/1 "2015-06-29T07:11:05Z")

</div>

Hello,

my chief architect means G1GC is awesome and works better then default GC. He mentioned, [https://www.elastic.co/guide/en/elasticsearch/guide/current/\_don\_8217\_t\_touch\_these\_settings.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/_don_8217_t_touch_these_settings.html) is outdated. We run Elasticsearch with oracle java 8 with "-Xms28g -Xmx28g -XX:+UseG1GC -XX:+UseCompressedOops -XX:+AlwaysPreTouch ....". I feel, that the original settings works better

Does anyone know of reasons why default GC is better? Sorry for stupid question, but I'm not professional with GC tuning. I need a few reasons to convince my chief architect....

Cheers  
Michael

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 29, 2015, 8:07am UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521/2 "2015-06-29T08:07:53Z")

</div>

Take a look at [http://wiki.apache.org/lucene-java/JavaBugs](http://wiki.apache.org/lucene-java/JavaBugs) and you will see why we don't support G1GC.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [June 29, 2015, 8:33am UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521/3 "2015-06-29T08:33:07Z")

</div>

Your chief architect is right and does not need to be convinced. G1GC is awesome and solves many of my challenges with heap scalability and low latency.

Quoting Uwe Schindler, Lucene committer:

> On the other hand Oracle works very much on G1 to guarantee speed and accuracy. When observing the Lucene builds during recent months, the Lucene team noticed that the errors initially seen no longer occurred. This is also consistent with the statement by Oracle that G1GC is “ready for production” in Java 8 Update 40.

> **[blog - devmio - Software Know-How](https://devm.io/blog/)**
>
> \[...\]Read More...

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 29, 2015, 8:57am UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521/4 "2015-06-29T08:57:27Z")

</div>

Interesting.

I guess that applies to java 9, which I don't think we are saying is yet compatible with ES.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [June 29, 2015, 1:44pm UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521/5 "2015-06-29T13:44:49Z")

</div>

> [@jprante](#):
>
> Your chief architect is right and does not need to be convinced. G1GC is awesome and solves many of my challenges with heap scalability and low latency.

Maybe I'm just paranoid, but I'm not going to use g1 until people say its safe in [[LUCENE-5168] ByteSliceReader assert trips with 32-bit oracle 1.7.0\_25 + G1GC - ASF JIRA](https://issues.apache.org/jira/browse/LUCENE-5168) - there is just too much history of it not working.

I'd _love_ to use. Really really really would.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [June 29, 2015, 4:25pm UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521/6 "2015-06-29T16:25:41Z")

</div>

I tried to reproduce the issues in my specific setup extensively, but I could not reproduce G1 related failures, since Java 8u5. The setup is Red Hat Linux 6.6/7, physical machines (no virtual machines), 64 bit, Java 8.

Since I studied the ongoing OpenJDK and G1 developments, and also Linux kernel related issues with JVM on low level, I am familiar with that problem space. I am confident I can fix any issues thanks to the open source stack.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [June 29, 2015, 4:39pm UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521/7 "2015-06-29T16:39:32Z")

</div>

It applies to Java 8u40+

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [June 29, 2015, 6:17pm UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521/8 "2015-06-29T18:17:51Z")

</div>

> [@jprante](#):
>
> Since I studied the ongoing OpenJDK and G1 developments, and also Linux kernel related issues with JVM on low level, I am familiar with that problem space. I am confident I can fix any issues thanks to the open source stack.

If you can debug GC issues then you are the perfect person to use it. I think its worth putting your notes in that issue though.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 29, 2015, 10:52pm UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521/9 "2015-06-29T22:52:04Z")

</div>

Interestingly there is this article on the same site as the OP, 3 days earlier - [blog - devmio - Software Know-How](http://jaxenter.com/kirk-pepperdine-on-the-g1-for-java-9-118190.html)

> Kirk Pepperdine on the G1 for Java 9: “I’d like to see more time before making it the default”

---

<div class="post-metadata">

**Author:** ![Michael\_\_Rennecke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael__rennecke/32/3484_2.png) [@Michael\_\_Rennecke](https://discuss.elastic.co/u/Michael__Rennecke)\
**Post date:** [June 30, 2015, 8:21am UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521/10 "2015-06-30T08:21:02Z")

</div>

tanks

---

<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:** [July 6, 2017, 12:04am UTC](https://discuss.elastic.co/t/gc-settings-for-elasticsearch/24521/11 "2017-07-06T00:04:36Z")

</div>


