More specifically, this is AjaxStateManager in Richfaces 3.1.HomeMadePatch/JSF1.1. I am not responsible for these technological choices, and I already read related questions like 1, 2, 3 which basically advice to upgrade versions or switch for a stateless JSF, which I would be very glad to do if I could, but due to the big hugeness of the application I am afraid I can't do this.
Back to the topic, I am currently trying to optimize memory heap consumption. Since my predecessors set a session scope for almost every bean, and set a server timeout of 6 hours (with some javascript refreshing before it expires in the browser), users have very long sessions and keep accumulating memory. I made some optimization on my own (well it is kind of simulating conversation scope: when hitting some pages, I clean everything in the main beans). Now when the users come back to main page their session wheights around 300kb, broken down as follow:
- AjaxStateManager$SynchronizedStateHolder: 280kb
- Other objects in session: 20kb
Those results were obtained by making heapdump and analyzing memory with Eclipse MAT. As you can see, 93% of the memory is Ajax maintening useless states. I want to force it to release those useless states. Any Idea on how to do this?
I thought about limiting the number of views it can save but in some pages there are some very weird form imbrications that I am unsure it would not break if I did.
Thanks in advance..