PDA

View Full Version : Tree memory usage while caching loaded AsyncTreeNodes



digeomel
5 Oct 2007, 5:39 AM
Hello,

I have a TreePanel which starts by loading a static alphabetical index of letters-nodes. Every letter in this initial tree is an AsyncTreeNode with multiple children AsyncTreeNodes. I have set the TreePanel's singleExpand config option to true to save some memory when a user expands a new node at the same level, but apparently, the default behavior of TreePanel is to cache the results of a previous load in memory and then load them from memory if the same node is expanded again. This is a good thing when the whole tree is not too big, so that you don't have to connect to the server again and again for the nodes already loaded, but in my case, as the user expands more and more nodes, the memory usage seems to increase and the browser becomes less and less responsive.

So, ideally, there should be a value like the maximum number of nodes to keep loaded in memory, after which consequent loads overwrite the cached values of previously loaded nodes.

Alternatively, if the former is not possible, I would like to have a way to tell the tree not to cache the loaded nodes, but to actually perform the load every time.

So, is there something I can do about this?