I have a Silverlight TreeView where each node is a TreeNodeViewModel. The properties on the TreeNodeViewModel's are, Text, IsSelected, ImageUri, and Parent. I'm loading about 700 to 1000 TreeView items.
What seems to be happening is that after loading the TreeView via the binding in the HierarchicalDataTemplate, the IE Browser's footprint grow's from about 48,000kb to 165,000kb. I'm using a ViewModel for the TreeView itself, which has bindings for ExpandAll and CollapseAll. When I envoke the expand command, the IE footprint continues to grow to almost 300,000kb. Once the tree is fully expanded, repeating expand & collapse does not increase the footprint; that is, it seems to level off once all the ViewModels are created.
My question is, if I'm loading about 800 TreeView items, is it expected that the footprint should be as large as it is in my case? Has anyone ever seen an IE excesive footprint from loading large amounts of data?
Some background on the SL app I'm developing: The hardware device (aka: server) is proprietary hardware and has an embedded web-server, similar to a linksys router. A compressed config file (model entities) is loaded to the device, and the SL app downloads it, decompresses it, and deserializes it using the DataContractSerializer. The file compressed is about 1.75MB, uncompressed is about 12.5MB.
My first thought was that the IE footprint was large because of the deserialization of the model. Initially when IE starts, the footprint is about 7500kb, loading the model into memory runs it up to 48,000kb.
Any thoughts or suggestions will be greatly appreciated.
I would recommend using a profiler like YourKit profiler or the like to at least get a memory profile on what is taking up the memory. It will help finding out what your hotspots are in terms of memory consumption and help track down any memory leaks.
Is 165MB too much? Can you force a GC.Collect in case this memory usage isn't putting too much pressure on the GC and so may be mostly garbage?
Definitely try out the profiler to get a better idea of the profile of your app.