I have a silverlight application containing a pivotgrid that is populated with a flatdatasource. In this particular scenario, when I set the pivotgrid.datasource property to the flatdatasource, memory usage increase by 75MB. This has been confirmed by breaking the application just before and just after the .datasource property is set. So far there is nothing unusual, as the pivotgrid has to build some internal data structures to manage the data.
The problem arise when I later set the .datasource property to nothing to empty the grid. I would then expect the memory usage to drop by the same amount (or at least close to), but this does not happen. Even more interesting, if I continue to assign new flatdatasource objects to the .datasource property, then memory usage increase with 75 MB each time, finally resulting in an out-of-memory exception.
My first question; does the pivotgrid have a method to release all internal data structures that I can call after setting .datasource property to nothing?
I have also used a memory profiling tool to play around with my application. I have isolated the objects that increase in number and memory usage between each assignment to .datasource property. The sum of these objects total growth between each assignment is close to 75 MB. The memory stack for these objects look like this:
Starting at the bottom of this trace with propertychangedeventhandler and working towards the root we end up with filterfielditemcontrol before going into the silverlight runtime objects. Continuing from there we encounter an eventhandler for the resized event.
Now, if I read this trace correctly it seems like filterfielditemcontrol subscribes to the resized event. When the pivotgrid at some point cleans up its internal structures the filterfielditemcontrol appears to forget to unsubscribe to this event, leaving all those instances orphaned in memory, including their stack of referenced objects.
Can you please give a comment on this, either confirming my findings and a pointing towards a fix, or advice me on how to clean up the memory usage when emptying the grid.
Thanks in advance, Mikael
Hi
This is known issue that we have fixed and the fix will be released with December SR planed for middle of next week.
Sorry for inconvenience.
Regards
Todor
Did the December SR get dropped? Really need this update. Any new date for SR?
Mikael
Hi Mikael,
The December SR was shipped last week and should be available for download.
HTH,
I don't see the SR download on my Keys And Downloads page. Where do I find it?
Anyone?
Found it, sorry for disturbing. :-)