# Transport Client Close causes CG overhead limit exeeded

**URL:** <https://discuss.elastic.co/t/transport-client-close-causes-cg-overhead-limit-exeeded/83226>\
**Category:** Elasticsearch\
**Created:** [April 21, 2017, 2:49pm UTC](https://discuss.elastic.co/t/transport-client-close-causes-cg-overhead-limit-exeeded/83226 "2017-04-21T14:49:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wael](https://avatars.discourse-cdn.com/v4/letter/w/b9e5f3/32.png) [@Wael](https://discuss.elastic.co/u/Wael)\
**Post date:** [April 21, 2017, 2:49pm UTC](https://discuss.elastic.co/t/transport-client-close-causes-cg-overhead-limit-exeeded/83226/1 "2017-04-21T14:49:06Z")

</div>

Hello,

I encountered an issue with elasticseach transport client. When executing the close method i received the following exception:

Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.OutOfMemoryError: GC overhead limit exceeded  
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201)  
at com.google.common.cache.LocalCache.get(LocalCache.java:3937)  
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)  
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:51)  
at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:68)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:68)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:38)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33)  
at org.elasticsearch.common.inject.internal.FailableCache$1.load(FailableCache.java:39)  
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)  
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)  
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)  
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)  
... 69 more

After debugging, i see that the method goes in infinite loop.

I note that i am using elasticsearch 2.4.1 with elasticsearch client provided by servicemix: org.apache.servicemix.bundles.elasticsearch: 2.3.5\_1.

The code is the following:

{  
TransportClient client = null;  
try {  
Settings settings = Settings.settingsBuilder()  
.put("[cluster.name](http://cluster.name)", cluster).build();  
client = TransportClient.builder().settings(settings).build();  
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(host), port))  
//...  
} catch (NoNodeAvailableException e) {  
//.......  
} catch (Exception e) {  
//.......  
} finally {  
if (client != null) {  
client.close();  
}  
}  
}

---

<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:** [May 19, 2017, 3:02pm UTC](https://discuss.elastic.co/t/transport-client-close-causes-cg-overhead-limit-exeeded/83226/2 "2017-05-19T15:02:04Z")

</div>

Closed on May 19, 2017, 3:02pm UTC

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