| Author |
Message |
abcde
Joined: 25 Feb 2013 Posts: 2
|
Posted: Mon Feb 25, 2013 3:45 pm Post subject: Memory snapshot before / after GC? |
|
|
Forgive me if I'm asking in the wrong place for this.
I'd like to take a snapshot of my application's memory usage BEFORE a GC is performed. I suspect there is a memory leak / unnecessary object creation going on somewhere in my app, and would like to see a diff of before/after the full GC. A the profiler forces a GC as soon as I hit 'take memory snapshot', I can't see this data.
Are you aware of how I could view this? |
|
| Back to top |
|
 |
jessica.ramos
Joined: 23 Apr 2012 Posts: 76
|
Posted: Tue Feb 26, 2013 6:56 pm Post subject: |
|
|
Thanks very much for your post!
Unfortunately though, there isn't a way you can take a snapshot without forcing a garbage collection. This is for good reason though--without taking a garbage collection, the snapshot would include objects that were still in memory but didn't have any references to them. This could be misleading and also interfere with snapshot comparisons.
I realize you're concerned about the objects created and cleaned up between garbage collections, however I don't think you need to worry about these. To quote one of our artcles:
| Quote: |
"ANTS Memory Profiler forces a garbage collection when you take a snapshot. ... This behavior will not affect the results that you obtain, because an object which only exists for a short time on Gen 0, and which is never promoted to Gen 1, will never be the cause of a .NET memory problem. " |
(http://www.red-gate.com/SupportCenter/content/ANTS_Memory_Profiler/help/7.4/amp_dotnet_memory) _________________ Jessica Ramos
Technical Support
Red Gate Software Ltd. |
|
| Back to top |
|
 |
abcde
Joined: 25 Feb 2013 Posts: 2
|
Posted: Wed Feb 27, 2013 10:36 am Post subject: |
|
|
I'm essentially trying to identify sources of memory churn - I think a before/after GC snapshot would help here, but understand why it's not supported.
Thanks |
|
| 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