What happens when taking a snapshot?

2 posts, 0 answers
  1. Yao
    Yao avatar
    1 posts
    Member since:
    Jan 2011

    Posted 07 Aug 2012 Link to this post

    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?
  2. Mihail
    Mihail avatar
    75 posts

    Posted 07 Aug 2012 Link to this post


    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,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top