You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Andrea Del Bene (JIRA)" <ji...@apache.org> on 2018/01/23 16:39:02 UTC
[jira] [Comment Edited] (WICKET-6522) ThreadLocal leak in
PageStoreManager
[ https://issues.apache.org/jira/browse/WICKET-6522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16336032#comment-16336032 ]
Andrea Del Bene edited comment on WICKET-6522 at 1/23/18 4:38 PM:
------------------------------------------------------------------
[~papegaaij] you are right. I've seen that other issues like WICKET-5164 might be affected by this kind of solution. At the moment I don't have any better ideas so your solution is ok also for me.
was (Author: bitstorm):
[~papegaaij] you are right. I've seen that other issues like WICKET-5164 might be affected by this kind of solution. But I think we still can solve this issue with a simple change. So far the localthread boolean has been introduced to tell if valueUnbound has been called because session has been expired (or invalidated) or if it has been called as side effect of session attribute update. So in PageStoreManager.PersistentRequestAdapter.storeTouchedPages we should set the session attribute only the first time we need it:
{code:java}
@Override
protected void storeTouchedPages(final List<IManageablePage> touchedPages)
{
if (!touchedPages.isEmpty())
{
....
...nothing change here
....
//new code
String attributeName = getAttributeName();
if (getSessionAttribute(attributeName) == null)
{
setSessionAttribute(attributeName, entry);
}
}
}
{code}
In this way SessionEntry#valueUnbound is called only when session attribute is actually removed. It looks pretty safe to me.
> ThreadLocal leak in PageStoreManager
> ------------------------------------
>
> Key: WICKET-6522
> URL: https://issues.apache.org/jira/browse/WICKET-6522
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 7.9.0
> Environment: Wildfly 10 on CentOS 7 Linux.
> Reporter: Klaasjan Brand
> Priority: Major
>
> One of our heavy-used Wicket production applications has developed 'interesting' behaviour since upgrading to 7.9.0: after a while the system becomes slower and seems to need more CPU time to handle the same amount of requests. Threaddumps exposed that a lot of CPU time was consumed by java.lang.ThreadLocal$ThreadLocalMap.getEntryAfterMiss, pointing to a ThreadLocal leak.
> After making a heapdump (20g) of one of our servers we found lots of ThreadLocalMap$Entry objects referenced by org.apache.wicket.page.PageStoreManager$SessionEntry$1 containing the value Boolean.FALSE.
> Seems that boolean is new behaviour introduced by the fix for WICKET-6465 and is causing complications on servers like Wildfly we use which don't recycle threads.
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)