I have a web app with an ActiveMQ client. When undeploying the app, Tomcat logs the following messages.
Searching for "InactivityMonitor Async Task" and "TcpSocketClose", I found org.apache.activemq.transport.tcp.TcpTransport and org.apache.activemq.transport.InactivityMonitor which both start a ThreadPoolExecutor in their static intializers but never stop them. The ThreadPoolExecutors hold references to ActiveMQ classes which hold a reference to the webapp classloader. These references prevent the webapp classes from being unloaded when the webapp is undeployed. Due to this the servlet container runs out of memory after a few redeployments.
The ActiveMQ client should dispose all resources when being closed, including the ThreadPoolExecutors. Or to provide some methods to explicitly stop these Threads (like org.apache.activemq.thread.Scheduler.shutdown() does).