You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (Jira)" <ji...@apache.org> on 2020/06/01 13:30:00 UTC

[jira] [Resolved] (WICKET-6793) OOM in AsynchronousPageStore

     [ https://issues.apache.org/jira/browse/WICKET-6793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier resolved WICKET-6793.
--------------------------------
    Fix Version/s: 8.9.0
                   9.0.0-M6
       Resolution: Fixed

Thanks Vladimir, your analysis was spot on!

> OOM in AsynchronousPageStore
> ----------------------------
>
>                 Key: WICKET-6793
>                 URL: https://issues.apache.org/jira/browse/WICKET-6793
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 8.7.0
>            Reporter: Vladimir Kubinda
>            Assignee: Sven Meier
>            Priority: Major
>             Fix For: 9.0.0-M6, 8.9.0
>
>
> After migrating to version 8.X, we face an out-of-memory issue. To clear the locked memory, the server must be restarted several times a week. 
>  After analyzing the heap dumps, we found that the vast majority of the heap is AsynchronousPageStore.entryMap. We started looking for some solutions and found a WICKET-6629 error. I think this fix is ​​not enough and should include removing AsynchronousPageStore.Entry also from AsynchronousPageStore.entryMap not only from AsynchronousPageStore.entries.
> Let me explain what I think. If StoreSettings.isAsynchronous is set to true (default option), Wicket uses AsynchronousPageStore to store the pages.
> AsynchronousPageStore.storePage method inserts the entry to entryMap on line 278 (version 8.7.0). If the entries are not full, entry is inserts to entries queue on line 282. 
>  Then wait until the PageSavingRunnable poll entry from queue, store it and remove it from entryMap on line 209. Now everything is fine.
> But what if the entry's session is unbind (expires, logout etc.), and entry was already inserted into entries and entryMap? Therefore, there is an AsynchronousPageStore.unbind method that removes all entries for the session from entries queue. But entry that has not yet been saved (in PageSavingRunnable, because it was waiting in queue) still exists and will not be removed from entryMap.
> When the entry is inserted into the AsynchronousPageStore.entryMap and AsynchronousPageStore.entries queue, there is only one place where the entry can be deleted from the AsynchronousPageStore.entryMap, and that is on line 209 in PageSavingRunnable.run method. But when we deleted an entry from the AsynchronousPageStore.entries, the entry in the AsynchronousPageStore.entryMap remains there, because if statment on line 205 in PageSavingRunnable.run.
>  So now if you have thousands of users and the sites are huge, it's only a matter of time before it starts to cause a problem.
> I think solution is remove all entries from unbinded session from AsynchronousPageStore.entryMap.
> I hope that I'm right.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)