I'm currently having issues with tracking down the memory usage of a simple collection class in a WPF application. I'm using C#, .NET 3.5.
I'm creating a local List collection of a simple object that consists of 4 strings. I'm not actually adding any items to the list, but even though the List is defined as a local variable to the method, it would appear that the Memory Profiler is reporting that I have a live object of the List after the method and exited. I've tried forcing a GC but the List object remains.
Having replaced the List with an ObservableCollection, the results are the same.
Replace that with a simple array of the same simple object, and the Memory Profiler reports that I don't have any list instances of that array.
Is there a known issue with the Memory Profiler and Collections, and am I chasing a memory leak that isn't really there?