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.
Y'know... I just took a look at your last sample and I noticed that you are getting the image from the resource every time, so now that I think about it, I'm pretty sure that this is not re-using the same image instance. This looks like it is creating a new Image object every time you call into your GetRandomSourceImage method.
You should probably get each resource once and cache it (in a Dictionary, perhaps) so you can re-use the same image. That should save you a huge amount of memory.
Since you are re-using the same small set of images, I can't see any reason why the images should be making any significant difference here.
Clearly there must be something different between my machine and your Windows 7 64-bit machine, but what it might be is a mystery.
I doubt it's the version of the control. v11.2 was only recently release, so there's very little difference between the internal version I am using and the one you are using and there have been no changes to the tree that I can see.
Also, since the memory usage on my machine does not change much from 9.1 to 11.2, it seems unlikely that there has been any change in the control to account for the difference.
So that pretty much just leaves the version of Visual Studio and the DotNet Framework. Your sample is in Vs2008 and my version of that is
9.0.30729.1 SP
And the version of the DotNet Framework I am using for your sample is 3.5 SP1.
So maybe check those versions on your machine(s) and see if there is any consistency there.
At first it seemed this was a 32-bit vs 64-bit OS issue. Most but not all the 64-bit platforms tested had ~700MB usage when the tree was loaded once. All the 32-bit platforms tested only use ~100MB when the tree was loaded once. I have confirmed it has nothing to do with v9.1 vs v11.2. The newer version does indeed use less memory by comparison in all circumstances.
Windows XP Pro SP2 (32-bit): ~100MB
Windows 7 Pro SP1 (64-bit): ~700MB
Windows Server 2008 SP2 (64-bit): ~100MB
Windows Server 2008 R2 SP1 (64-bit): ~700MB
I have been frantically trying to figure out what makes the Server 2008 SP2 machine stand out. I'm not sure if it could have to do with installed dotNET versions / service packs, enabled windows features, or what. I haven't had any luck yet.
I don't want to have to resort to dropping the Infragistics tree control from my application, but if I can't find a solution soon, I will have to. Any advice on how to hunt this issue down? ANTS isn't any help because the memory usage is all unmanaged.
I have confirmed that the issue is all about the node images. If I don't set the node LeftImages, the application uses very little memory on all platforms (~25MB). Could this be an issue with GDI?
Oh sorry, I see you stated you are using Windows 7 64-bit. I don't understand this at all because when I run the example app on my workstation (Windows 7 Professional 64-bit) the memory usage is over 600 megs when loading the tree once.
Can you appease me and run this release mode application using the contained assemblies, and verify the memory usage does not change?
Oh well unfortunately I cannot upload a file larger than 200k. Is there some other way I can get this deployment to you for testing?
Hi Mike,
Can I ask what OS you are using for your tests? I am trying to figure this out and hopefully find a remedy. Part of this is running on a variety of operating systems and comparing the memory usage. It would be good to know what you are using for a comparison.
When I have results from all my available operating systems, I'll post back.