-
1. uicomponent tree memory usage
mp911de Jan 31, 2011 1:46 AM (in response to dmitry.kudrenko)Do you have one Page with all your Modal-Panels? Have you tried to split those on multiple pages?
-
2. uicomponent tree memory usage
dmitry.kudrenko Jan 31, 2011 3:51 AM (in response to mp911de)I have a lot of pages. But I also has a lot of popups on each page. For example: I have list of Customers with ability to view customer details in a popup, and so on, and for Edit Customer I have several popups to select Address, some Attachments, etc...
-
3. uicomponent tree memory usage
ilya_shaikovsky Jan 31, 2011 5:05 AM (in response to dmitry.kudrenko)It's better to use single panel but load different subviews via ajax like there:
<rich:modalPanel >
<a4j:outputPanel layout="block" id="lp">
<ui:include src="#{pagecontroller.currentPane}"/>
</a4j:outputPanel>
</rich:modalPanel>
...
<a4j:command reRender="lp" action="#{pagecontroller.setEditPane}" oncomplete="#{r:component('paneId')}.show()">
<a4j:command reRender="lp" action="#{pagecontroller.setViewDetailsPane}" oncomplete="#{r:component('paneId')}.show()">
-
4. uicomponent tree memory usage
dmitry.kudrenko Feb 1, 2011 4:54 AM (in response to ilya_shaikovsky)Thank you for reply. But unfortunately it doesn't work for me. I tried to explain the same problem in the original post based on <c:if example.
Your example works only partially. The problem that when lp panel is rerendered it generates new UI component tree, and a4j:controls will stop work when modal panel is generated first time, because of html part and server view are unsynchronized.
It can start work if you will rerender area with these controls onClose event for this modalPanel. But it doesn't look like proper solution.
-
5. uicomponent tree memory usage
dmitry.kudrenko Feb 1, 2011 4:58 AM (in response to ilya_shaikovsky)I tried to do the following to improve the situation
Configure number of views in session inside web.xml with:
<context-param>
<param-name>com.sun.faces.numberOfViewsInSession</param-name>
<param-value>3</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.numberOfLogicalViews</param-name>
<param-value>6</param-value>
</context-param>It has to improve StateHolder object, but it doesn't help a lot. I did measuring and memory usage is grows when these number are grow. But, when i tired to set them to 1,1 - some pages stopped work. Sometimes request is forwarded to the welcome page. 2,2 improved the situation, but the issue with forwarding to welcome pages still happens.
Tried to use client mode in javax.faces.STATE_SAVING_METHOD. It still uses a lot of memory for UIComponent model. Even if objects are serialised and have to be stored in the form.
Tried to rewrite stateManagerin faces.config:
<state-manager>org.ajax4jsf.application.CompressAjaxStateManager</state-manager>
and rewrite buildViewState and restoreView for compressing the stream. It doesn't help a lot.