Legacy Knowledge Base
Published Jul. 2, 2025

ThreadLocal Leaking Caused by Usages of Netty in Elasticsearch

Written By

Justin Choi

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

This article documents a possible known issue where there is ThreadLocal leak shown in the console logs when shutting down the application server:

org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks 
The web application [ROOT] created a ThreadLocal with key of type
[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@ccb08cb]) and a value
of type [io.netty.util.internal.InternalThreadLocalMap] (value
[io.netty.util.internal.InternalThreadLocalMap@21c8be8a]) 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.

Resolution

Status: Won't Fix

Liferay Support Engineers have determined that the leak is caused by Netty, a third party vendor. There is a util method in Netty that attempts to clean up Threadlocal leaks but the error message still persists after the method has been invoked. It was discovered that this error is very common to implementations of Netty, including a dependency inside Elasticsearch, and most vendors, including Elasticsearch, will ignore the error. As a result, Liferay Support Engineers have deemed the impact to Liferay platforms and to customers to be minimal.

Additional Information

For more information, see LPS-83704.

Did this article resolve your issue ?

Legacy Knowledge Base