| Summary: | WeakRef$Remover is not stopped when server webapp/war is undeployed | ||
|---|---|---|---|
| Product: | [RT] Riena | Reporter: | Jürgen Becker <juergen.becker> |
| Component: | Core | Assignee: | Stefan Liebig <Stefan.Liebig> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 4.0.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
The "WeakRef remover" thread is now a Job and will be canceled when the riena.core bundle shuts down. |
The WeakRef starts a new Remover(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 WeakRef. Something like this will show up - even after undeploying the webapp: "WeakRef remover" daemon prio=10 tid=0x0000000041b82000 nid=0x212a in Object.wait() [0x00007f37be168000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00000000fecd5188> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118) - locked <0x00000000fecd5188> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134) at org.eclipse.riena.core.util.WeakRef$Remover.run(WeakRef.java:91) The running thread can prevent the container from freeing resources, resulting in memory leaks.