# CMSInitiatingOccupancyFraction not having any effect on GC trigger

**URL:** <https://discuss.elastic.co/t/cmsinitiatingoccupancyfraction-not-having-any-effect-on-gc-trigger/204230>\
**Category:** Elasticsearch\
**Created:** [October 18, 2019, 12:49pm UTC](https://discuss.elastic.co/t/cmsinitiatingoccupancyfraction-not-having-any-effect-on-gc-trigger/204230 "2019-10-18T12:49:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amit\_Agarwal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amit_agarwal/32/56165_2.png) [@Amit\_Agarwal](https://discuss.elastic.co/u/Amit_Agarwal)\
**Post date:** [October 18, 2019, 12:49pm UTC](https://discuss.elastic.co/t/cmsinitiatingoccupancyfraction-not-having-any-effect-on-gc-trigger/204230/1 "2019-10-18T12:49:38Z")

</div>

Hi,  
CMSInitiatingOccupancyFraction=75 flag does not seem to have any effect on GC. The GC starts at about 85-95 % old gen usage and makes the cluster status as yellow. I am using 1.7 version with java 8. Any idea what might trigger it? Below are the flags:

/bin/java -Xms30g -Xmx30g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -XX:+CMSClassUnloadingEnabled -XX:-AssumeMP

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [October 25, 2019, 1:13pm UTC](https://discuss.elastic.co/t/cmsinitiatingoccupancyfraction-not-having-any-effect-on-gc-trigger/204230/2 "2019-10-25T13:13:11Z")

</div>

Hi,

please see [Oracle's GC tuning guide](https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/cms.html#concurrent_mark_sweep_cms_collector) and the [JVM options documentation for Java 8](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#BABFAFAE) for details about these flags. I suggest that you enable garbage collection logs and inspect them to analyze GC behavior. You can start by adding the following flags:

```auto
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/path/to/your/gc/log/file/here/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=32 -XX:GCLogFileSize=64m

```

(these are derived from our [default GC log configuration in newer versions of Elasticsearch](https://github.com/elastic/elasticsearch/blob/edab3748e9d12a512e7ab1f2bc2d9292bc4b9ed1/distribution/src/config/jvm.options#L105-L114)).

Daniel

---

<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:** [November 22, 2019, 1:13pm UTC](https://discuss.elastic.co/t/cmsinitiatingoccupancyfraction-not-having-any-effect-on-gc-trigger/204230/3 "2019-11-22T13:13:15Z")

</div>

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