Performance problems with polling and forms

UI Components for JSF
Post Reply
User avatar
imanol
Posts: 20
Joined: 04 Nov 2010, 13:16

04 Apr 2011, 16:43

Hi!
I'm doing a web aplication where I have to monitorize the value of different variables. I have 3 main elements on the xhtml file:
1) A tree with different checkboxes to select which variables I want to monitorize. Every time I check and uncheck a variable the datagrid is updated.

Code: Select all

<p:tree value="#{monitorBean.root}" var="node" expanded="true"
                                selectionMode="checkbox" selection="#{monitorBean.selectedNodes}"
                                propagateSelectionUp="true" nodeSelectListener="#{monitorBean.displayVariables}"
                                propagateSelectionDown="true" update="data:table"
                                expandAnim="FADE_IN" collapseAnim="FADE_OUT">
    <p:treeNode>
        <h:outputText value="#{node.nombre}" />
    </p:treeNode>
</p:tree>
2) A datagrid with all the data I have to show, that gets updated every second with values from a database.

Code: Select all

<p:dataGrid var="variable" value="#{monitorBean.selectedVariables}" columns="5"
                                    rows="20" paginator="true" effect="true" paginatorPosition="top"
                                    paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {ColumnsPerPageDropdown}"
                                    rowsPerPageTemplate="15,20,25" id="table" rendered="#{monitorBean.viewType}" paginatorAlwaysVisible="false">
                            <p:column style="min-width: 20%">
                                <p:panel id="panel" header="#{variable.nombre}" toggleable="true" styleClass="dataGridPanel" >
                                    <h:panelGrid columns="1" style="width:100%">
                                        <h:outputText id="gridValue" title="#{mon.valor}" value="#{variable.binario? (monitorBean.binaryHex?variable.bytesLines8:variable.hex):variable.valorUnidad}" escape="false"/>
                                        <p:commandLink title="#{mon.masinfo}" update="dialogPanel" oncomplete="varDialog.show()" value="#{mon.info}">
                                            <f:setPropertyActionListener value="#{variable}"
                                                                         target="#{monitorBean.selectedVariable}" />
                                        </p:commandLink>
                                    </h:panelGrid>
                                </p:panel>
                            </p:column>
                        </p:dataGrid>
3) And a poll, that updates the value of each datagrid's value text output

Code: Select all

<p:poll id="updatePoll" actionListener="#{monitorBean.updateValues}" interval="1"
                            update="#{monitorBean.updateTabla}"/>
When I check 3 or 4 variables from the tree the datagrid gets updated quickly, but if I want to show more variables the aplication becomes slow. For example, If I check one option on the tree, it takes 3-4 seconds to update the datagrid.

Is there any problem on doing this? Should I use one form for the whole page or one form per element(menu, data/poll)? Am I doing something wrong?

Thanks for your help. I started some months ago using primefaces to build my Final Year Project application but I still I have a lot of things to learn about it.

PD: I'm using Mojarra 2.1.0+Primefaces 2.2.1+glassfish 3

User avatar
imanol
Posts: 20
Joined: 04 Nov 2010, 13:16

11 Apr 2011, 12:18

Hi again.

I have been working on this issue, and I have found out that while the polling is on, the amount of memory of the process increases, and at one point the aplication gets inestable. If you use chromium (or chrome, I guess), you can check it with the "View background pages" feature of the browser.

In my case, when the polling is off, the memory needed by the process is constant, but if I turn it on, it increases heavily until I have to close the browser because the user interface doesn't respond to actions (mouse clicks, etc).

User avatar
bumble.bee
Posts: 723
Joined: 29 Sep 2010, 21:39
Location: United States

11 Apr 2011, 14:22

There is another report of a memory leak with poll:

http://primefaces.prime.com.tr/forum/vi ... f=3&t=5708

I decided against using p:poll (and p:push) because they didn't seem production worthy. It probably makes sense to create an issue ticket here:

http://code.google.com/p/primefaces/issues/list

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

11 Apr 2011, 16:16

Hi,

PrimeFaces poll is a little bit strange. You can start it, but not stop :-) http://www.primefaces.org/showcase/ui/pollStartStop.jsf
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
imanol
Posts: 20
Joined: 04 Nov 2010, 13:16

11 Apr 2011, 16:18

ok, I'll wait some time for more responses, and otherwise I'll post an issue.

Thanks!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 37 guests