# Garbage Collection Not Working

**URL:** <https://discuss.elastic.co/t/garbage-collection-not-working/197173>\
**Category:** Elasticsearch\
**Created:** [August 28, 2019, 4:27pm UTC](https://discuss.elastic.co/t/garbage-collection-not-working/197173 "2019-08-28T16:27:39Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [September 10, 2019, 6:01am UTC](https://discuss.elastic.co/t/garbage-collection-not-working/197173/5 "2019-09-10T06:01:20Z")

</div>

Hi,

in the output that you've shared privately with me we can see:

```auto
        "gc_collectors" : [
          "PS Scavenge",
          "PS MarkSweep"
        ]

```

This means that the CMS garbage collector is in use. This is because you're running on JDK 8 and it is the default garbage collector there. The provided JVM options are (I've omitted any system properties):

```auto
        "input_arguments" : [
          "-Xms29500m",
          "-Xmx29500m"
        ]

```

This is _very_ minimal (even the GC is unspecified) so it appears to me you have a very non-standard `jvm.options` file. I suggest you compare your `jvm.options` file with [Elasticsearch's default `jvm.options` file for version 6.6](https://github.com/elastic/elasticsearch/blob/6.6/distribution/src/config/jvm.options) and add any missing lines. Note that that file is only a template, so you need to ensure to replace any placeholders (e.g. `${heap.dump.path}`) with proper paths on your system (see the comments in the file for guidance).

After you've done this, you should have:

- Correct system properties set (you're missing several of them, e.g. `-Dio.netty.noUnsafe=true`)
- JVM options are set so you will have garbage collection logs and also the garbage collector is explicitly configured instead of implicitly chosen by the JVM (this could bite you when upgrading the JVM).

If in doubt you can always share any files or output privately.

Daniel

---

_[View the full topic](https://discuss.elastic.co/t/garbage-collection-not-working/197173)._
