How do I monitor memory usage of AppDomains in my Process hosted in a Windows Service? RRS feed

  • Question

  • Hello,

    We have a Windows Service (or a console) that hosts multiple AppDomains.  We would like to monitor the memory usage of each AppDomain.  The Process is of .NET 4.5, is hosted on Windows 7, and is being developed with VS 2013 in C#.

    The example we used came from:

    However we noticed the memory values reported are way too low, and suspected that they are being updated even after Gen0, Gen1, and non-blocking Gen2 garbage collection.  We expect memory update only after a full and blocking GC collection.

    This is the same issue reported few years ago without a workaround in the thread:

    In addition, we have tried to implement a solution which handles full GC collection without much success: In this exercise, we were able to capture the real memory usages of the first few AppDomains before they are reset again by other GC collections.

    Does anyone else have the same experience and is able to provide a workaround?



    Thursday, March 27, 2014 3:40 PM

All replies

  • Hi Jerry,

    I am trying to involve someone familiar with this issue to come into this thread. Thank you for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 28, 2014 6:35 AM