This is a migrated thread and some comments may be shown as answers.

What happens when taking a snapshot?

1 Answer 63 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yao
Top achievements
Rank 1
Yao asked on 07 Aug 2012, 09:57 AM
Everytime I take a memory snapshot on my application, my application's memory usage indicated by the windows task manager is suddenly reduced. However, I cannot get the same effect by calling GC.Collect in my code. So I want to know what does JustTrace do when taking a snapshot to force memory be freed?
Thanks!

1 Answer, 1 is accepted

Sort by
0
Mihail
Telerik team
answered on 07 Aug 2012, 10:28 AM
Hi,

Thank you for your question. Every time JustTrace takes a memory snapshot it uses ICorProfilerInfo::ForceGC method. As far as I know there is no difference in the implementation of ICorProfilerInfo::ForceGC() and System.GC.Collect() methods.

I would like to point you to this blog post which I find useful. The results I get with JustTrace, Visual Studio and GC.Collect() are quite similar.


All the best,
Mihail
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
General Discussions
Asked by
Yao
Top achievements
Rank 1
Answers by
Mihail
Telerik team
Share this question
or