Hi, have used a memory profiler on a project which has revealed a memory leak for my app. The issue is that when I remove nodes from the UltraWinTree references to these removed nodes are still being held in the private visibleNodes variable of type VisibleNodesManager within the UltraWinTree. Is there a way for me to 'refresh' this list? I cannot find any method which might help in this regard. Or, could anyone suggest a workaround for this?
I am using version 6.1.20061.1069 of the UltraWinTree.
Many thanks in advance.
Pete.
Hi Mike,
Could I ask you to take another look at the code base. Specifically, at the .Key property of the generic Entry<UltraTreeNode , TreeNodeUIElement> within the entries generic dictionary.
This is the thing that's holding onto a reference of the UltraTreeNode that's been removed from the Tree.
Many thanks for all your help.
Sorry for the delay in replying - time differences!
I've now had the chance to use a different Memory profiler, which enables me to force garbage collections between snapshots of memory. This new profiler still shows the same problem, despite the collections.
Maybe I'm not expressing myself accurately, but I feel strongly there is a problem here. It's very unlikely 2 different packages pointing to the same cause of the memory leak are wrong.
Is there a way I can email you screen shots containing the chain of dependencies, as I'd rather not post everything here?
Cheers
Hi Pete,
Ah, that's different, then. I took another quick look at the code and don't see any obvious leaks here, though. This dictionary gets cleared every time the control positions it's UIElement. So that basically means every time it paints and something has changed. So removing a node would certainly be included in the category.
If you can post a sample project that demonstrates the leak, I'd be happy to take a look, but I wonder if your testing just isn't doing garbage collection or something.
Below is a portion of the dependency list generated by the memory profiler which shows the relevant variable names and types.
Hope this helps?
I think I might have mislead you about the VisibleNodesManager in 9.2.
While that was the cause of the leak in v6.1, it now appears there is a DIFFERENT memory leak in v9.2 which I thought was the visible nodes thing!
This new leak is in a Dictionary called 'entries' belonging to a variable called nodeElements within another variable called nodeClientAreaUIElement
It would seem this dictionary is holding onto references of removed nodes!
I should also point out that I have downloaded a trial version of v16.1 and this new leak is present there too!
Any suggestions for workarounds?
Any help gratefully received.