Using an ImageAnnotation on a plot, each updates sets the ImageAnnotation.ImageSource with a new OxyImage. I'm using a memory profiler which shows me that these OxyImage objects are duplicating their datasource and not being cleared away as they never
come out of context whilst the plot is active.
I'm not sure I 100% understand what it going on here but this is definitely the cause of my issues as just commenting out the line which creates the OxyImage solves the issue. Over an hour or so I am getting over 1GB of memory being used which in turn ends
up in the application crashing.
using (Bitmap b = updateScatterArray())
using (MemoryStream stream = new MemoryStream())
image = new OxyImage(stream);
foreach (ImageAnnotation a in IntensityPlotModel.Annotations)
a.ImageSource = image;
Any help / pointers greatly appreciated. This is getting quite urgent now!! Ta.