Finally nailed: Here is the issue: when normal http lifecycle, the code does release the ThreadLocal objects, but when Session Invalidated (session timeout, server shutdown, undeploy), it create the Session and LazyHttpConversationContextImpl's ThreadLocal object, but only released the Sesison's ThreadLocal, the LazyConversationContext stuck in the memory, here is the trace:
Normal Http request:
org.jboss.weld.context.http.HttpRequestContextImpl@1e29326 - org.jboss.weld.context.AbstractManagedContext$ManagedState@10cbbdb org.jboss.weld.context.http.HttpSessionContextImpl@62b8bc - org.jboss.weld.context.AbstractManagedContext$ManagedState@e5154b org.jboss.weld.context.http.LazyHttpConversationContextImpl@106ada0 - org.jboss.weld.context.AbstractManagedContext$ManagedState@1561ff8
org.jboss.weld.context.http.LazyHttpConversationContextImpl@106ada0 - removed org.jboss.weld.context.http.HttpRequestContextImpl@1e29326 - removed org.jboss.weld.context.http.HttpSessionContextImpl@62b8bc - removed
Session Invalidate (Server Shtudown, Session Timeout):
org.jboss.weld.context.http.HttpSessionContextImpl@62b8bc - org.jboss.weld.context.AbstractManagedContext$ManagedState@27b52 (create) org.jboss.weld.context.http.LazyHttpConversationContextImpl@106ada0 - org.jboss.weld.context.AbstractManagedContext$ManagedState@70c75d (create)
org.jboss.weld.context.http.HttpSessionContextImpl@62b8bc - removed
You see the LazyHttpConversationContextImpl is not released in this case.
|