Home - Forums-.NET - FlyTreeView (ASP.NET) - Slow FlyTreeView after removing nodes.

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Slow FlyTreeView after removing nodes.
Link Posted: 02-Nov-2007 03:31
Hi all.

I have a problem with the FlyTreeView.

I populate my TreeView with the PopulateNodes event, and it all works fine in the beginning. Im having a lot of data and the tree becomes more and more slow when adding new nodes. This is ofcourse ok since it is a lot of data.

The problem is if I collapse all the rootnodes and remove the childnodes in the OnNodeEventJavascript with the following code: node.clearChildNodes(); (Have also tried removing the nodes by running through the childnodes and removing them that way) - it is still very slow when it has to repopulate the tree. It's like it dosen't clear the tree/nodes at all clientside. The tree seems to update the state serverside.

Any ideas?
Link Posted: 02-Nov-2007 04:30
After you call clearChildNodes() method, nodes (and corresponding HTML objects) are removed from treeview structure.
Anyway these nodes stay in browser memory and slow down HTML DOM operations (style changes, etc.) This behavior varies for different browsers.
So the only way to free memory and speed up treeview is to postback page.
Link Posted: 16-Jun-2009 01:11
I can understand that, after removing the child nodes using clearChildNodes, the memory is not released.
But the problem is that the memory is also NOT released after RELOADING the page.

I have a node with 2000 child nodes.  When I just expand the node, then reloads the page, there is no problem.
However, when I expand the node, then clear the child nodes using clearChildNodes, the memory taken by Internet Explorer is NOT released even after reloading the page.

We have bought the source code.  Is there something we can change to avoid this problem ?
Link Posted: 17-Jun-2009 07:38
IE keeps history, and any page load is in history, takes memory, etc.
We have no control on it. What FlyTreeView does - it removed node elements from DOM.

What version of IE do you use?
Link Posted: 17-Jun-2009 19:58
This is not serious!  There is a huge memory leak caused by the removeChild method.  You can find a lot of information related to this problem on the internet.
Btw we're using IE7 & IE8.  Both versions have the problem.
Link Posted: 17-Jun-2009 20:19
Thank you. Good hint for us. We need to experiment with this. Currently it looks to be CPU consuming for IE to discard large number of nodes.