# How to set G1GC in docker

**URL:** <https://discuss.elastic.co/t/how-to-set-g1gc-in-docker/222457>\
**Category:** Elasticsearch\
**Created:** [March 6, 2020, 12:34pm UTC](https://discuss.elastic.co/t/how-to-set-g1gc-in-docker/222457 "2020-03-06T12:34:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![roflmao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roflmao/32/21606_2.png) [@roflmao](https://discuss.elastic.co/u/roflmao)\
**Post date:** [March 6, 2020, 12:34pm UTC](https://discuss.elastic.co/t/how-to-set-g1gc-in-docker/222457/1 "2020-03-06T12:34:36Z")

</div>

Running elasticsearch 7.6.1 in docker  
Setting ES\_JAVA\_OPTS env:

> -XX:+UseG1GC -Xms16g -Xmx16g -XX:-UseConcMarkSweepGC -XX:UseCMSInitiatingOccupancyOnly -XX:InitiatingHeapOccupancyPercent=75

elasticsearch doesnt start:

> configure-sysctl 2020-03-06T12:10:52.753271813Z vm.max\_map\_count = 262144  
> elasticsearch 2020-03-06T12:31:42.118036031Z OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.  
> elasticsearch 2020-03-06T12:31:42.11896733Z Error occurred during initialization of VM  
> elasticsearch 2020-03-06T12:31:42.118991753Z Multiple garbage collectors selected

What am i missing? Cant find any documentation around this topic.

---

<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:** [April 3, 2020, 12:34pm UTC](https://discuss.elastic.co/t/how-to-set-g1gc-in-docker/222457/2 "2020-04-03T12:34:36Z")

</div>

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