title: ElasticSearch Java TransportClient leaking byte[]
body: <p>ElasticSearch Java TransportClient <strong>5.5.1</strong> seems to be leaking byte arrays. Even if i just connect and close, commenting the code in between, it leaks.</p>
  
  <p>The code:</p>
  
  <pre><code>try (PreBuiltTransportClient preBuiltTransportClient = new PreBuiltTransportClient(settings)) {
       try(TransportClient transportClient=preBuiltTransportClient.addTransportAddress(
              new InetSocketTransportAddress(InetAddress.getByName(endPoint),javaPort))){
           //do something
       }
  }
  </code></pre>
  
  <p>Plugin loading log (may indicate something):</p>
  
  <p><a href="https://i.stack.imgur.com/dRRSf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dRRSf.png" alt="Loaded plugins log"></a>
  VisualVM Heap dump showing byte[] allocated size on the heap (after forcing a garbage collection):</p>
  
  <h2><a href="https://i.stack.imgur.com/dUEwx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dUEwx.png" alt="VisualVM"></a></h2>
  
  <p>Seems to be the same problem as posted here:
  <a href="https://discuss.elastic.co/t/are-there-memory-leaks-in-elasticsearchs-transportclient-5-4-3-or-is-my-code-flawed/91989/5" rel="nofollow noreferrer">https://discuss.elastic.co/t/are-there-memory-leaks-in-elasticsearchs-transportclient-5-4-3-or-is-my-code-flawed/91989/5</a></p>
  
  <p>Not sure if relevant, but I am using Spring boot on the same project.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT:</p>
  
  <p>Seems to be related to Compression:</p>
  
  <p><a href="https://i.stack.imgur.com/gCbIi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gCbIi.png" alt="enter image description here"></a></p>
  
  <p>EDIT2:</p>
  
  <p>The memory consumption increases greatly on TransportClientNodesService.addTransportAddresses</p>