# Garbage Collection of my java/spring application keeps spiking

**URL:** <https://discuss.elastic.co/t/garbage-collection-of-my-java-spring-application-keeps-spiking/323277>\
**Category:** Elasticsearch\
**Created:** [January 16, 2023, 8:27pm UTC](https://discuss.elastic.co/t/garbage-collection-of-my-java-spring-application-keeps-spiking/323277 "2023-01-16T20:27:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RuchikG](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@RuchikG](https://discuss.elastic.co/u/RuchikG)\
**Post date:** [January 16, 2023, 8:27pm UTC](https://discuss.elastic.co/t/garbage-collection-of-my-java-spring-application-keeps-spiking/323277/1 "2023-01-16T20:27:55Z")

</div>

We have a java application built on java and spring which connects to Elastic Search cluster with version 7.6.1. We are using spring-data-elasticsearch dependency with version 4.0.0 RELEASE and elasticsearch dependecy with version 7.6.2 and elasticsearch-rest-high-level-client dependency with version 7.6.2. The problem we are facing is that we are seeing spikes in garbage collection for our application which is causing our app to restart very frequently and makes the application unstable? This only started happening after we implemented the elasticsearch changes. Can you please suggest what could be the cause of this?

---

<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:** [January 16, 2023, 9:05pm UTC](https://discuss.elastic.co/t/garbage-collection-of-my-java-spring-application-keeps-spiking/323277/2 "2023-01-16T21:05:46Z")

</div>

Welcome to our community! 😃

It's not clear what you mean by "Elasticsearch changes", can you elaborate? Also Elasticsearch 7.6 is [EOL](https://www.elastic.co/support/eol) and no longer supported, please upgrade.

---

<div class="post-metadata">

**Author:** ![RuchikG](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@RuchikG](https://discuss.elastic.co/u/RuchikG)\
**Post date:** [January 16, 2023, 10:40pm UTC](https://discuss.elastic.co/t/garbage-collection-of-my-java-spring-application-keeps-spiking/323277/4 "2023-01-16T22:40:56Z")

</div>

The Elasticsearch changes are just adding connection to Elasticsearch cluster and building ingestion pipeline as well as an api to get the data from Elasticsearch. That's it! The version of Elasticsearch isn't controlled by us since we don't own the Elasticsearch cluster ourselves, is there any other solution for this?

---

<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:** [February 13, 2023, 10:41pm UTC](https://discuss.elastic.co/t/garbage-collection-of-my-java-spring-application-keeps-spiking/323277/5 "2023-02-13T22:41:20Z")

</div>

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