Author |
Topic  |
|
marco
18 Posts |
Posted - 19 Nov 2003 : 12:20:26
|
Hi,
I am using your multiline plot and have all licenses.
I have an application that uses one multiline graph and two bar graphs.
I am noticing a "memory leak" ONLY when my multiline graph is enabled. About 4k's every 5 seconds or so, (from Task Manager)which isn't so bad, but my application logs data and can be on all the time. I had a similar problem before, but it turned out that every time I was adding new points to the end of the dataset, I wasn't deleting the ones form the begining. That problem is solved, and I'm wondering what else I'm missing. The only thing I'm adding, to and not deleting from, is the currentDate. But that should just change the currentDate and not add to it, no?
I've included my update method. It is the only method I call in the whole control. Any insight would be greatly appreciated.
Regards,
Marco
GIVEN:
public void AddNewPoints(double[] dblPointsToDraw) { ChartCalendar xValue = (ChartCalendar)currentdate.Clone(); GroupPoint2D newdata= new GroupPoint2D(xValue, dblPointsToDraw);
c_Dataset.AddGroupDataPoints(newdata); intNumberOfPoints = c_Dataset.GetNumberDatapoints(); c_PTransform.AutoScale(c_Dataset,ChartObj.AUTOAXES_EXACT, ChartObj.AUTOAXES_EXACT); c_PTransform.SetTimeScaleStart(c_Dataset.GetTimeXDataValue(intNumberOfPoints-100));
c_XAxis.CalcAutoAxis(); c_YAxis.CalcAutoAxis(); //c_XAxisLab.CalcAutoAxisLabels(); c_YAxisLab.CalcAutoAxisLabels();
currentdate.Add(ChartObj.MILLISECOND,110); if(intNumberOfPoints > 100) { c_Dataset.DeleteGroupDataPoints(0); } this.UpdateDraw();
}
|
|
marco
18 Posts |
Posted - 19 Nov 2003 : 12:49:25
|
Hi again,
I think I found what is getting bigger all the time. I put an "Add watch" in VS.NET on currentDate from my method. So, in Chart2dnet.ChartObject.ChartObjType.ChartIDCntr: The value is of type Int. When I start the program, the value is 7073. After about 10 secs the value is 822573. At 20 secs the value is 1605343. At 30 secs the value is 2246534. after 8mins value is 15639204. Could this be the cause of the "leak"? If so, what can I do about it?
regards,
Marco |
 |
|
quinncurtis
1164 Posts |
Posted - 19 Nov 2003 : 16:05:17
|
I don't know if the task manager memory usage is an appropriate tool to use. In theory the C# garbage collection should release memory, when it is needed by other processes, otherwise there is no guarantee that the memory will be released. So the objects allocated by a timer may not be released for some time. Run the app overnight and see what the memory usage is.
Also, place a call to
System.GC.Collect() in the timer loop.
It is supposed to force some level of garbage collection.
|
 |
|
|
Topic  |
|
|
|