Program starts at 22MB and after a minute climbs to 47 MB
Removing the code
radialGauge1.Value = GaugeValue;
And memory is steady.
I get same memory leak updating a bar chart.
Updating both Gauge and Chart memory is consumed very fast.
I made a simple test program, It eats memory in both cases using a timer event or manually pushing a button.
Code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
int counter;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//// Run this procedure in an appropriate event.
//counter = 0;
//timer1.Interval = 100;
//timer1.Enabled = true;
//// Hook up timer's tick event handler.
//this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
}
private void timer1_Tick(object sender, System.EventArgs e)
{
counter++;
if (counter > 100)
{
counter = 0;
}
radialGauge1.Value = counter;
}
private void button2_Click(object sender, EventArgs e)
{
counter++;
if (counter > 100)
{
counter = 0;
}
radialGauge1.Value = counter;
}
}
}
Could it be I am using version 4.6-VS2017 Toolbox 16.2.0.41
It’s been so long I forgot how I installed these tools. I better update to the latest version 19.2.0.44 yikes.
Upgraded and tested it works now as you say , I get maximum of 44mb after 3 minutes. Thanks!