| Author |
Message |
jwebsdale
Joined: 10 Mar 2009 Posts: 1 Location: Cambridge, UK
|
Posted: Tue Mar 10, 2009 1:22 pm Post subject: Question about memory profiling of collections |
|
|
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?
Thanks,
Jonathan |
|
| Back to top |
|
 |
Chris.Allen
Joined: 12 Mar 2009 Posts: 443
|
Posted: Thu Mar 12, 2009 5:23 pm Post subject: |
|
|
Hello Jonathan,
no there are no known issues of the memory profiler giving spurious information of this nature. Something is still maintaining a reference to those generic collections. I think you should be able to get a "second opinion" on this simply by loading up those collections with multiple objects and observing the memory usage in Windows task manager.
Hope this helps. |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group