Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8276373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:21:12+00:00 2026-06-08T08:21:12+00:00

I have 10 charts in my page and I refresh them using poll component

  • 0

I have 10 charts in my page and I refresh them using poll component every 1 minute.
But after one hour i see that firefox and chrome got more that 1 GB of memory and sometimes even firefox crashes.

Is this a memory leak caused by primefaces chart?
How can I solve the problem?

Here is the source code for my example application:

In this code interval is set to 3 seconds to see the problem sooner!

<h:body>

    <h:form id="timerForm">
        <p:poll interval="3" widgetVar="timer" update=":chartPanel" autoStart="true" /> 
    </h:form>
    <p:panelGrid columns="2" id="chartPanel">

        <p:lineChart id="chart1" value="#{chartController.model}"
                             legendPosition="nw" style="height:200px;width: 500px;" minY="0" />
        <p:lineChart id="chart2" value="#{chartController.model}"
                             legendPosition="nw" style="height:200px;width: 500px;" minY="0" />
        <p:lineChart id="chart3" value="#{chartController.model}"
                             legendPosition="nw" style="height:200px;width: 500px;" minY="0" />
        <p:lineChart id="chart4" value="#{chartController.model}"
                             legendPosition="nw" style="height:200px;width: 500px;" minY="0" />
        <p:lineChart id="chart5" value="#{chartController.model}"
                             legendPosition="nw" style="height:200px;width: 500px;" minY="0" />
        <p:lineChart id="chart6" value="#{chartController.model}"
                             legendPosition="nw" style="height:200px;width: 500px;" minY="0" />

    </p:panelGrid>

</h:body> 

And here is the bean:

@Named
@RequestScoped
public class ChartController {

static final Logger log = Logger.getLogger(ChartController.class.getName());

@PostConstruct
private void init() {
}

private ChartSeries getData(String label) {
    ChartSeries data = new ChartSeries();
    data.setLabel(label);
    for (int i = 1; i <= 20; i++) {
        data.set(i, Math.random() * 1000);
    }
    if (data.getData().isEmpty()) {
        data.set(0, 0);
    }
    log.log(Level.INFO, "Chart loaded for :{0}", label);
    return data;
}

public CartesianChartModel getModel() {
    CartesianChartModel chartModel = new CartesianChartModel();
    chartModel.addSeries(getData("Data 1"));
    chartModel.addSeries(getData("Data 2"));
    chartModel.addSeries(getData("Data 3"));
    return chartModel;
}
}

When I close the browser, it completely releases memory.
And here is the source code to download:
I have uploaded the source code, it’s a maven project, just download it and open it in your IDE and deploy it in your app server.

https://dl.dropbox.com/s/secmuo7vjasdaue/chart-bug.zip?dl=1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:21:14+00:00Added an answer on June 8, 2026 at 8:21 am

    The component does not destroy resources before refreshing.
    I found that this is a bug in version 3.3.1 and is fixed in 3.4-SNAPSHOT

    Here is the reference:

    http://forum.primefaces.org/viewtopic.php?f=3&t=18286&hilit=chart+memory+leak

    http://code.google.com/p/primefaces/issues/detail?id=4183

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built some highcharts charts and I am displaying them one at a
I have generated four charts on the html page using amchart in 4 divs
I have page with multiple charts rendered using fusion charts and I am pulling
I have two vertical bar charts (created using jqPlot) in my HTML page. They
Kindly i have a page and in the page i have two pie charts,
I have an code segment of view .cshtml page like : @Html.ActionLink(Add Charts of
I have been using Telerik Charts with Asp.net mvc and I have run into
I have created some simple charts (of type FastLine) with MSChart and update them
I have created a dozen different charts using the chart form wizard in Access
I have a page with 6 dojox.charting.Chart2d charts that works fine in all browsers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.