ElasticSearch Java TransportClient 5.5.1 seems to be leaking byte arrays. Even if i just connect and close, commenting the code in between, it leaks.
The code:
try (PreBuiltTransportClient preBuiltTransportClient = new PreBuiltTransportClient(settings)) {
try(TransportClient transportClient=preBuiltTransportClient.addTransportAddress(
new InetSocketTransportAddress(InetAddress.getByName(endPoint),javaPort))){
//do something
}
}
Plugin loading log (may indicate something):
VisualVM Heap dump showing byte[] allocated size on the heap (after forcing a garbage collection):
Seems to be the same problem as posted here: https://discuss.elastic.co/t/are-there-memory-leaks-in-elasticsearchs-transportclient-5-4-3-or-is-my-code-flawed/91989/5
Not sure if relevant, but I am using Spring boot on the same project.
Any ideas?
EDIT:
Seems to be related to Compression:
EDIT2:
The memory consumption increases greatly on TransportClientNodesService.addTransportAddresses
Solution here: https://github.com/elastic/elasticsearch/issues/26048
It's not a leak, it's from netty pooled allocator.
Set io.netty.allocator.type=unpooled to disable.
System.setProperty("io.netty.allocator.type", "unpooled");
OR
-Dio.netty.allocator.type=unpooled
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With