jqPlot browser memory leak on chart update

UI Components for JSF
cam317
Posts: 1
Joined: 10 Feb 2012, 19:19

10 Feb 2012, 19:33

Hi,

Im working with primeface 3.1, when I update a <p:barChart/> from ajax event on <p:selctOneRadio/> , the browser (IE8, Chrome or Mozilla 10) memory increse about 100MB per request, it seams like it doesnt clear the javascript memory on the browser and saves all data needed to build the chart, it is posible to check this problem at the primefaces showcase http://www.primefaces.org/showcase/ui/liveChart.jsf or http://www.primefaces.org/showcase-labs ... eChart.jsf, in this case browser memory is increased about 4MB after each ajax poll request in the windows task manager.

Deploying on Glassfish 3.1.1.

Think, anyone reported this bug before...

Thanks

Ryland
Posts: 19
Joined: 30 Jun 2011, 18:55

06 Jun 2012, 18:50

I am seeing something similar but my p:barchart is being updated due to a p:poll. I have only been checking the memory usage in Firefox 12 and 13 and deployed on Jboss 7.1.1 with Primefaces 3.2.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

06 Jun 2012, 18:55

I think it's only related to jqplot.

Cagatay, is it possible to use: this.plot.destroy() before creating the new plot after ajax update?
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Ryland
Posts: 19
Joined: 30 Jun 2011, 18:55

06 Jun 2012, 19:48

I just retested using 3.3 and still seeing the memory leak. Im going to try 3.4-SNAPSHOT next.

Edit: 3.4-SNAPSHOT also shows the same thing.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

06 Jun 2012, 19:59

I could create an patch and try if this.plot.destroy() after ajax update would work but i have not time, sorry. Maybe you should check the charts.js and widget architecture yourself and createn patch + issue if you fixed it.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

08 Jun 2012, 17:29

I fixed it by calling destroy() when a chart widget is updated;

Issue: http://code.google.com/p/primefaces/iss ... il?id=4183

Commit: http://code.google.com/p/primefaces/sou ... ail?r=7586

I've tested without the fix, memory started with 150mb, jumped to 500mb after 5 minutes.

With the fix, it stays pretty much the same.

Thanks everyone for the feedback.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

08 Jun 2012, 18:08

Cool, thanks!
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

08 Jun 2012, 18:10

Thanks for the fix... (have to start using jqPlot next week with a poll l;-)

Ryland
Posts: 19
Joined: 30 Jun 2011, 18:55

12 Jun 2012, 16:06

I must have another memory leak on my dashboard page because the memory usage just keeps climbing and all the page has is a barchart, multiple panelGrid's which have outputText, a couple of graphicImage's with a p:poll that refreshes the page every 5 seconds.

Edit: I decided to retest after clearing Firefox and its cache and now it seems like the memory usage isnt going up anymore. Thanks!

jina_lu
Posts: 24
Joined: 17 Jan 2013, 12:35

17 Jan 2013, 12:46

I'm facing the same problem as described here. Using primefaces 3.4.2 plus myfaces 2.1.10.
In my page I have dashboard with several panels each displaying chart (used extender also) live updated using p:poll component every 2-5 seconds.
I guess that it some other problem as mention earlier fix should be already in this primefaces release.
Any ideas or suggestions what should I check?

Thanks in advance...
Primefaces 5.1
Tomcat 7.0.50

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests