Using
TeeChart VCL version 710 with BDS 2006 (C++Builder) and
TeeChart VCL version 8 Build 8.08.80307 with RAD 2009 (C++Builder)
I've noticed an effect that I called "Residual Memory" when using TeeChart with huge series of data.
In my real application, it is normal to open studies with series managing data from 10,000 up to 100,000 points. To be worst, there is a dozen of charts and each one has 3 or 5 different series.
I've created a test application with a simple TChart, a TFastLineSeries and two buttons Fill and Clear with code like that:
Code: Select all
void __fastcall
TFormMain::BtFillClick(TObject *Sender)
{
Series->Clear();
for (int i=0; i<100000; i++)
{
Series->AddXY(i, rand() % 100,"", clTeeColor);
}
}
//---------------------------------------------------------------------------
void __fastcall
TFormMain::BtClearClick(TObject *Sender)
{
Chart->SeriesList->ClearValues();
// Series->Clear();
// Chart->FreeAllSeries();
}
//---------------------------------------------------------------------------
Code: Select all
---------------------------------------------
#Points Initial After Fill After Clear
---------------------------------------------
1,000 1844 1868 1860
1860 1860
---------------------------------------------
10,000 1844 2072 2072
2072 2072
---------------------------------------------
100,000 1844 4084 2512
4124 2552
4124 2552
---------------------------------------------
I can reproduce the same behavior with FreeAllSeries(), without repeating the Fill call for a second time.
I hope you have any hint about it, because in my real application it kind of keep consuming memory, even when my users close a huge study and open a small one.
Best,
Marcelo.