Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
UltraTree & memory usage
posted

Hi,

Very recently my application that uses an UltraTree started consuming vast resources. I have found that a single node object when part of a heirarchy will consume upwards of 50KB.

Furthermore if I add the root node object to a tree control's nodes collection, clearing the tree's node collection (using nodes.clear() ) does not release the references to the nodes. This means if you build a tree, then clear it's nodes and try to rebuild it, you will be holding two full trees in memory. At upwards of 50KB per node, this will bring a system to it's knees when you are working with trees containing thousands of nodes.

The same project used to consume far less resources prior to upgrading to 2011.1. Can you please advise?

I have attached a simple project that procedurally generates a tree as an example (using 2011.2 where the problem still exists).

Thanks.

UltraTreePlayground.rar
Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    I ran your sample, but there doesn't appear to be any code in it for tracking the amount of memory usage. How are you determining the memory usage? Are you using a memory profiler? Or are you relying on the Windows Task Manager.

    I would strongly advise against using the TaskManager, as it will not give you an accurate portrayal of the memory usage for a DotNet application, since it does not account for Garbage collection.

    There is also nothing in your sample that disposes of the nodes or the tree control, so I don't see how this sample could demonstrate that the the nodes.Clear method is not releasing the resources.

    And since your sample generates a random number of nodes each time, it's impossible to make any comparison between one version and the next.

    So on what are you basing the claim that the tree uses more memory in the latest version?

     

     

Children