Memory Leak Messages When Shutting Down Apache Tomcat Web Container Running AM (All Versions) - ForgeRock Backstage
Memory Leak Messages When Shutting Down Apache Tomcat Web Container Running AM (All Versions) - ForgeRock Backstage
The purpose of this article is to provide assistance if you see memory leak messages
when shutting down the Apache Tomcat™ web container running AM. You will see
messages such as "WARNING: The web application [AM] appears to have started a
thread named [ ] but has failed to stop it. This is very likely to create a memory leak." and
"SEVERE: The web application [AM] created a ThreadLocal with key of type [ ] (value [ ])
and a value of type [ ] (value [0]) 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."
Symptoms
Messages similar to the following are shown in catalina.out when shutting down the Tomcat web
container:
https://backstage.forgerock.com/knowledge/kb/article/a55893580 1/4
12/3/23, 8:40 AM Memory leak messages when shutting down Apache Tomcat web container running AM (All versions) | ForgeRock Backstage
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [AM]
appears to have started a thread named [OpenDJ LDAP SDK Default Scheduler] but has failed to stop
it. This is very likely to create a memory leak. Stack trace of thread:
...
Or:
Or:
Note
https://backstage.forgerock.com/knowledge/kb/article/a55893580 2/4
12/3/23, 8:40 AM Memory leak messages when shutting down Apache Tomcat web container running AM (All versions) | ForgeRock Backstage
These messages can also occur if you repeatedly redeploy the AM war whilst Tomcat is running; AM
is not intended to be un-deployed/deployed without a container restart.
Recent Changes
N/A
Causes
You can find more information on these memory leak messages at Tomcat Wiki - MemoryLeakProtection.
Solution
These messages can be safely ignored providing Tomcat is not prevented from shutting down. As they
occur during shutdown, any memory leaks will cease once the process has ended.
If Tomcat fails to shut down properly, you can forcibly end the process using kill -9 as follows:
2. End the process using the following command and the identified process ID, for example:
$ kill -9 2240
3. Repeat step 2 if more than one process is running for the AM instance you are trying to shut down
(this can happen if you started and stopped the instance again).
See Also
AM (All versions) fails to start due to SEVERE: ContainerBase.addChild: start: error on Apache Tomcat
https://backstage.forgerock.com/knowledge/kb/article/a55893580 3/4
12/3/23, 8:40 AM Memory leak messages when shutting down Apache Tomcat web container running AM (All versions) | ForgeRock Backstage
Related Training
N/A
https://backstage.forgerock.com/knowledge/kb/article/a55893580 4/4