I've wasted most of the day trying to figure out why my application was
leaking memory.

 I was dynamically adding and removing columns from the AdvancedDataGrid. I
noticed that it was slowing down a lot.  I naturally assumed that it was my
custom item renderer and even after reading Alex's blog entry about using
the profiler I couldn't figure out what was holding references to my item
renderer.

 Anyway the error continued to happen after I commented out all the code in
my item renderer.  I even changed it to subclass
AdvancedDataGridItemRenderer, still no joy.  So I removed the custom item
renderer and noticed that instead of my ItemRenderer the ADG didn't remove
references to its own item renderer.

Anyway I changed to a standard DataGrid and all worked correctly.  The
references were removed when garbage collection occurred I had to change my
code a bit.

This isn't really a question more of a complaint really.  I don't know if it
was my code or just a problem with the ADG though I suspect the latter.

A couple of things I noticed with the standard DG.  Firstly if setting the
itemrenderer on the DG itself it also uses the same ItemRenderer on the
header rows.  Is this correct behaviour.  Setting the ItemRenderer on the
column seems to keep the normal header renderer.  This I admit has me
confused is this the way its supposed to work?  How would I set all the
cells to a custom IR and leave the headers alone?  It seems inconsistent.

I have read the excellent Articles on Alex's blog.

Anyway that's all.

Regards,

Wes

Reply via email to