The thread-pool from which the "ActiveMQ-client-global-threads-1227208364" thread comes is a static pool created for the instances of org.apache.activemq.artemis.api.core.client.ServerLocator in the JVM. This pool is designed to hang around until the JVM is shutdown. If you don't want this behavior and/or don't want to share a static pool between all your ServerLocator instances then you should set useGlobalPools to false either on the object itself or in the URL you provide it. Aside from that you could just ignore the warning because it's a false positive IMO.
Justin ----- Original Message ----- From: "vishal3007" <[email protected]> To: [email protected] Sent: Sunday, March 5, 2017 6:08:29 AM Subject: Artemis: Memory leak while shutting down the tomcat server with embedded JMS server I am using Artemis server as an embedded server in my webapp. The Embedded server is started as spring-bean as explained in the Spring Integration examples provided by Artemis. When tomcat server is shut down following warning comes in console: Mar 05, 2017 5:41:09 PM org.apache.catalina.core.StandardServer await INFO: A valid shutdown command was received via the shutdown port. Stopping the Server instance. Mar 05, 2017 5:41:09 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["http-nio-8080"] Mar 05, 2017 5:41:09 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["ajp-nio-8009"] Mar 05, 2017 5:41:09 PM org.apache.catalina.core.StandardService stopInternal INFO: Stopping service Catalina Mar 05, 2017 5:41:10 PM org.springframework.context.support.ClassPathXmlApplicationContext doClose INFO: Closing org.springframework.context.support.ClassPathXmlApplicationContext@7feef2a0: startup date [Sun Mar 05 17:40:40 IST 2017]; root of context hierarchy Mar 05, 2017 5:41:10 PM org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl stop INFO: AMQ221002: Apache ActiveMQ Artemis Message Broker version 1.5.3 [59915ee6-019a-11e7-a49a-005056c00008] stopped, uptime 29.048 seconds Mar 05, 2017 5:41:10 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads WARNING: The web application [Spring4MVCHelloWorldRestServiceDemo] appears to have started a thread named [threadDeathWatcher-1-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) io.netty.util.ThreadDeathWatcher$Watcher.run(ThreadDeathWatcher.java:150) io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144) java.lang.Thread.run(Thread.java:745) Mar 05, 2017 5:41:10 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads WARNING: The web application [Spring4MVCHelloWorldRestServiceDemo] appears to have started a thread named [Thread-0 (ActiveMQ-client-global-threads-1227208364)] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745) Mar 05, 2017 5:41:10 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [Spring4MVCHelloWorldRestServiceDemo] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@198498b3]) and a value of type [io.netty.util.internal.InternalThreadLocalMap] (value [io.netty.util.internal.InternalThreadLocalMap@357b809a]) 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. Mar 05, 2017 5:41:10 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [Spring4MVCHelloWorldRestServiceDemo] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@198498b3]) and a value of type [io.netty.util.internal.InternalThreadLocalMap] (value [io.netty.util.internal.InternalThreadLocalMap@26e9b16a]) 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. Mar 05, 2017 5:41:10 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["http-nio-8080"] Mar 05, 2017 5:41:10 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["ajp-nio-8009"] Mar 05, 2017 5:41:10 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["http-nio-8080"] Mar 05, 2017 5:41:10 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["ajp-nio-8009"] -- View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-Memory-leak-while-shutting-down-the-tomcat-server-with-embedded-JMS-server-tp4722906.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.
