[英]ElasticSearch Java TransportClient leaking byte[]
ElasticSearch Java TransportClient 5.5.1似乎泄漏了字節數組。 即使我只是連接並關閉,在其間評論代碼,它也會泄漏。
編碼:
try (PreBuiltTransportClient preBuiltTransportClient = new PreBuiltTransportClient(settings)) {
try(TransportClient transportClient=preBuiltTransportClient.addTransportAddress(
new InetSocketTransportAddress(InetAddress.getByName(endPoint),javaPort))){
//do something
}
}
插件加載日志(可能表示某些內容):
VisualVM堆轉儲顯示堆上的byte []已分配大小(強制執行垃圾回收后):
似乎與此處發布的問題相同: https : //discuss.elastic.co/t/are-there-memory-leaks-in-elasticsearchs-transportclient-5-4-3-or-is-my-code-有缺陷的/5分之91989
不確定是否相關,但我在同一個項目上使用Spring啟動。
有任何想法嗎?
編輯:
似乎與壓縮有關:
EDIT2:
TransportClientNodesService.addTransportAddresses的內存消耗大大增加
解決方案: https : //github.com/elastic/elasticsearch/issues/26048
它不是泄漏,而是來自netty池化分配器。
將io.netty.allocator.type = unpooled設置為禁用。
System.setProperty("io.netty.allocator.type", "unpooled");
要么
-Dio.netty.allocator.type=unpooled
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.