You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is problem with the registerStopEvent in PerThreadContext$PerContextThreadWrapper. The registration keeps a reference to the wrapper in both the monitored object (this) and the cleanup action (this.instances). That causes an eternal reference to the wrapper, together with all the cached values.
It was probably originally intended to monitor the PerThreadContext object. But the whole registration is not necessary at all, because when the wrapper gets collectable (as it happens via PerThreadContext.shutdown()), the contained instances map is going to be released, too.
The whole problem is reproducible with Jersey clients and XML payload: JerseyMemoryTest.txt
The text was updated successfully, but these errors were encountered:
There is problem with the
registerStopEvent
inPerThreadContext$PerContextThreadWrapper
. The registration keeps a reference to the wrapper in both the monitored object (this
) and the cleanup action (this.instances
). That causes an eternal reference to the wrapper, together with all the cached values.It was probably originally intended to monitor the
PerThreadContext
object. But the whole registration is not necessary at all, because when the wrapper gets collectable (as it happens viaPerThreadContext.shutdown()
), the containedinstances
map is going to be released, too.The whole problem is reproducible with Jersey clients and XML payload:
JerseyMemoryTest.txt
The text was updated successfully, but these errors were encountered: