Page 1 of 1

Using ColorGrid.Bitmap results in OutOfMemory exception

Posted: Tue Sep 05, 2006 9:26 pm
by 9641603
Hi,

My app displays big (1000 x 1000) color grids of data at user request. For efficiency purposes we're using ColorGrid.Bitmap to pass data to the series. It works very well, the only problem is that if the user keeps switching the plot, the allocated memory (Committed Bytes counter) goes up and eventually (after 6-12 times) I get an OutOfMemoryException. What's scary is that the memory often climbs up by as much as 200 MB at a time!

My suspicion is that this is related to the Bitmap property. I have tried to feed the color grid a sample 10x10 bitmap instead and the memory behavior is much more reasonable - it still goes up every time I switch plots but at a much slower rate.

Also, adding a GC.Collect() call each time the user switches plots doesn't help at all.

Could someone at Steema please take a look at the code surrounding the Bitmap property and give me some hints? I suspect that the Bitmap is not being released or something...

Best,
Michal Blazejczyk

Posted: Tue Sep 05, 2006 9:55 pm
by 9641603
Actually, the same behavior exists when I use FillSampleValues(1000) though it is less extreme, the memory drops occasionally (but the trend is still there, considerably so).

Another fun fact: each time such a large grid is redrawn, memory usage goes up by about 30-50 MB! :shock:

Ouch!

Hope to hear from you soon as I need to release a Beta... :?

Michal Blazejczyk

Posted: Wed Sep 06, 2006 11:51 am
by narcis
Hi Michal,

Which version of TeeChart are you using? Could you please download the latest debug version to see if there's any improvement?

Thanks in advance.