# ClassLoading in Elasticsearch

**URL:** <https://discuss.elastic.co/t/classloading-in-elasticsearch/39061>\
**Category:** Elasticsearch\
**Created:** [January 13, 2016, 6:44am UTC](https://discuss.elastic.co/t/classloading-in-elasticsearch/39061 "2016-01-13T06:44:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArivazhaganJ](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@ArivazhaganJ](https://discuss.elastic.co/u/ArivazhaganJ)\
**Post date:** [January 13, 2016, 6:44am UTC](https://discuss.elastic.co/t/classloading-in-elasticsearch/39061/1 "2016-01-13T06:44:26Z")

</div>

I am using elasticsearch 1.5.1 and Java 7 with Spring Web application environment. In PROD, we got Out of Memory: Perm Gen error in Elasticsearch instance log file.

So based out of this, I understand class loading happens on Elasticsearch instance. I need to know how to control or fix class loading and unloading issue in Elasticsearch instance?

Our web application closes all clients properly through shutdown hook. But still tomcat provides an alert stating few of the un closed threads and Thread local reference. Through this I am just curios to know if this has anything with Elastic search Class loading capability.

Note: I performed various tests via Tomcat application, and found that Client close() parameter do not have any impact on Out of Memory : perm gen in Elasticsearch Cluster.

Please help.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 13, 2016, 7:07am UTC](https://discuss.elastic.co/t/classloading-in-elasticsearch/39061/2 "2016-01-13T07:07:47Z")

</div>

I ran in the same issue years ago.  
IIRC it was due to a Guava issue.

I ended up shutting down the whole tomcat instance instead of only uninstalling the web application.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 13, 2016, 10:04am UTC](https://discuss.elastic.co/t/classloading-in-elasticsearch/39061/3 "2016-01-13T10:04:54Z")

</div>

Use Java 8 to get rid of Permgen once and forever.

Note, Java 7 is no longer supported by Oracle.  
Am 13.01.2016 07:54 schrieb "Arivazhagan Jeganathan" \<  
[noreply@discuss.elastic.co](mailto:noreply@discuss.elastic.co)\>:

---

<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:** [July 5, 2017, 11:24pm UTC](https://discuss.elastic.co/t/classloading-in-elasticsearch/39061/4 "2017-07-05T23:24:59Z")

</div>


