TreeView.Items.Filter Memory Leak, HELP!
I'm having this terrible problem, i have a tree view and i'm using the it's Items.Filter to support search options.
My TreeView is also virtual开发者_JAVA百科ized cuase it contains tones of items and if not virtualized it takes a minute for the UI to load.
My problem is that whenever i set a filter it seems that the memory usage grows by 20M!!!
- I don't understand why the ListBox won't use the items it already has and why it needs to create new items (i see calls to the child item's constructors)
- Why the hell won't it release the old UI elements from the memory?!
PLEASE HELP!!! Gili
Are you sure that the old UI elements aren't released? Try calling GC.Collect(); and see if you loose those 20M, this is not considered a good thing to do but it would verify if the UI elements are released or not.
And does it grow 20M each time you set a filter or just the first time?
精彩评论