| Author |
Message |
chrisgdg
Joined: 14 May 2012 Posts: 1
|
Posted: Mon May 14, 2012 2:43 pm Post subject: GC.Collect at point of snapshot? |
|
|
Hi,
I've been profiling the memory of my windows forms application which dynamically loads many WPF Image Viewer controls in an element host. It then disposes of them to load a new set etc.
I managed to discover a memory leak, and fixed it, however, even though i call GC.Collect(), the memory in task manager etc remains high, until i load more images, at which point it momentarily drops, and then raises again. I'm assumign that because the mory is now needed, .NET is removing it from the large heap, and then using it for the new image data.
If however i have the profile attached, and click on the Take Memory Snapshot button (Which, from your documentation calls GC.Collect() before collecting its data), the memory usage drops right down, as if its also clearing the data in the alrge heap.
Are you only using GC.Collect(), or is there anythign else yuou are doing that i could in my code to have the same affect of the actual memory use reducing in task manager?
Thanks,
Chris |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Mon May 14, 2012 3:47 pm Post subject: |
|
|
Hi,
ANTS Memory Profiler does a GC.Collect before a snapshot to ensure all of the objects that you have correctly disposed arenot reflected as live objects in the results. It's not doing anything special. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| 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