Community
Participate
Working Groups
The DeferringLoggerFactory starts a new DeferredLoggingForwarder(which extends Thread). On the client side this is no problem, because the thread is stopped when the client application is stopped, On the server side in a webapp container, like Tomcat, the thread is not stopped, after the application (war) is undeployed. To verify this, undeploy the webapp and create a thread dump via "jstack <pid>" and search for DeferredLoggingForwarder. Something like this will show up - even after undeploying the webapp: "DeferredLoggingForwarder" daemon prio=10 tid=0x00007f85381d4000 nid=0x1772 waiting on condition [0x00007f853fdc3000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00000000ffb60078> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399) at org.eclipse.riena.internal.core.logging.DeferredLoggingForwarder.run(DeferredLoggingForwarder.java:47) The running thread can prevent the container from freeing resources, resulting in memory leaks.
The "DeferredLoggingForwarder" thread is now a Job and will be canceled when the riena.core bundle shuts down.