Using ColorGrid.Bitmap results in OutOfMemory exception
Posted: Tue Sep 05, 2006 9:26 pm
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
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