# The Elasticsearch process is experiencing rapid memory growth in the older generation

**URL:** https://discuss.elastic.co/t/the-elasticsearch-process-is-experiencing-rapid-memory-growth-in-the-older-generation/343013
**Category:** Elasticsearch
**Created:** [September 14, 2023, 6:12am UTC](https://discuss.elastic.co/t/the-elasticsearch-process-is-experiencing-rapid-memory-growth-in-the-older-generation/343013 "2023-09-14T06:12:22Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![liguifa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liguifa/32/123959_2.png) [@liguifa](https://discuss.elastic.co/u/liguifa)
#### Post date: [September 14, 2023, 6:12am UTC](https://discuss.elastic.co/t/the-elasticsearch-process-is-experiencing-rapid-memory-growth-in-the-older-generation/343013/1 "2023-09-14T06:12:23Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/1/e/1e95e04df81e3b3b68695e1b93c082c56b792f2a.png)

As shown in the above figure, my Elasticsearch cluster has experienced rapid memory growth in its old age, and after a period of time, it will be reclaimed, which will also occupy a large amount of memory. How should I optimize it.

jvm options:  
/bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.locale.providers=SPI,JRE -Xms31g -Xmx31g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.type=unpooled -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j2.formatMsgNoLookups=true -Djava.io.tmpdir=/tmp/elasticsearch-2895824853792002806 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/lib/elasticsearch -XX:ErrorFile=/var/log/elasticsearch/hs\_err\_pid%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/var/log/elasticsearch/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=32 -XX:GCLogFileSize=64m -XX:NewRatio=1 -XX:MaxDirectMemorySize=16642998272 -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -Des.distribution.flavor=default -Des.distribution.type=rpm -Des.bundled\_jdk=true -cp /usr/share/elasticsearch/lib/\* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [September 14, 2023, 6:23am UTC](https://discuss.elastic.co/t/the-elasticsearch-process-is-experiencing-rapid-memory-growth-in-the-older-generation/343013/2 "2023-09-14T06:23:33Z")

</div>

Those options look like they come from a pretty old version. The simplest thing to try is to upgrade.

---

<div class="post-metadata">

### Author: ![liguifa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liguifa/32/123959_2.png) [@liguifa](https://discuss.elastic.co/u/liguifa)
#### Post date: [September 14, 2023, 6:27am UTC](https://discuss.elastic.co/t/the-elasticsearch-process-is-experiencing-rapid-memory-growth-in-the-older-generation/343013/3 "2023-09-14T06:27:15Z")

</div>

The ES version number is 7.8, I don't think it's ancient

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [September 14, 2023, 6:29am UTC](https://discuss.elastic.co/t/the-elasticsearch-process-is-experiencing-rapid-memory-growth-in-the-older-generation/343013/4 "2023-09-14T06:29:02Z")

</div>

Elasticsearch 7.8 may not be ancient, but it is still very old and has been EOL for a very long time. I would recommend you upgrade.

---

<div class="post-metadata">

### Author: ![liguifa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liguifa/32/123959_2.png) [@liguifa](https://discuss.elastic.co/u/liguifa)
#### Post date: [September 14, 2023, 6:31am UTC](https://discuss.elastic.co/t/the-elasticsearch-process-is-experiencing-rapid-memory-growth-in-the-older-generation/343013/5 "2023-09-14T06:31:49Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> Elasticsearch 7.8 may not be ancient, but it is still very old and has been EOL for a very long time. I would recommend you upgrade.

I just want to know why memory in the old days will periodically grow, or how to optimize this memory usage. Upgrading the version may not solve the problem, nor is it a good method

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [September 14, 2023, 6:46am UTC](https://discuss.elastic.co/t/the-elasticsearch-process-is-experiencing-rapid-memory-growth-in-the-older-generation/343013/6 "2023-09-14T06:46:43Z")

</div>

> [@liguifa](#):
>
> The ES version number is 7.8, I don't think it's ancient

There's been over 3 years of new development, and 75 new releases, since the version you are using. It's been unsupported for a very long time. I think I'd call it "ancient" at this point.

> [@liguifa](#):
>
> I just want to know why memory in the old days will periodically grow, or how to optimize this memory usage.

It's possible that someone will volunteer their time to help you investigate this, but it's not very likely when you're using such an old version. You're much more likely to receive help if you can reproduce your problems in a supported version.

---

<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: [October 12, 2023, 6:46am UTC](https://discuss.elastic.co/t/the-elasticsearch-process-is-experiencing-rapid-memory-growth-in-the-older-generation/343013/7 "2023-10-12T06:46:52Z")

</div>

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