Charts on Tabbed Pages causing memory leaks

Posted by: mikenap on 8 September 2017, 3:23 pm EST

  • Posted 8 September 2017, 3:23 pm EST

    Hello, I'm building a Windows Forms application that uses a Tab Control and Tabbed pages. On two of the pages I have four charts (two on each page). Currently, I am using three classes. A database class, a chart class, and the windows Form class.

    static class DatabaseClass
    {
    public static DataTable GetDataForChart()
    {
    // Query database.
    }
    }

    static class ChartClass
    {
    public static ChartModel GetChart()
    {
    // Build the chart from the database query.
    }
    }

    public partial class Form1 : Form
    {
    public Form1()
    {
    // Add the charts to the form on startup.
    fpChart1.Model = ChartClass.GetChart()
    }
    }

    Every time I tab through the tap pages with the charts, I can see the memory keep increasing. I'm thinking this may be from re-drawing the chart when I select the tap page, but I'm not sure. Does anyone know what could be causing the memory leak, and if there is a way to decrease it or remove it?
  • Marked as Answer

    Replied 8 September 2017, 3:23 pm EST

    Hi,

    Can you post a small sample showing the issue? It is not clear from the info provided what might be happening.

    Regards,
    -Sean
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels