DeflateCompressor threads causing memory leak in Tomcat

Hi,
using ES 7.17.10 in a Tomcat container (9.0.x). When the application is shutdown there are two threads that are not removed, causing memory leaks from the DeflateCompressor class.

In particular it would seem that the close() method in DeflateCompressor is never called. I use a RestHighLevelClient . I call close() on the client, but still end up with this in the Tomcat logs:

31-May-2023 10:31:20.686 SEVERE [Thread-3] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [gub-kat57] created a ThreadLocal with key of type [java.lang.ThreadLocal.SuppliedThreadLocal] (value [java.lang.ThreadLocal$SuppliedThreadLocal@676145c1]) and a value of type [org.elasticsearch.common.compress.DeflateCompressor.ReleasableReference] (value [org.elasticsearch.common.compress.DeflateCompressor$ReleasableReference@5e85e241]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

Welcome!

Which client are you using? If not the new Java Client, could you switch to this one?

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