none
CLR Memory Profiling - Efficient Way to Get Memory Details RRS feed

  • Question


  • I instrument the .Net code and rewrite the IL , take the call graph for each and every transactions comes to the IIS web sites. 

    Now i need to take the memory metrics. I am searching for a efficient mechanism to collect the following info:

    Object information - Object type , Size 
    Class info   - Class name , instances, size
    Garbage collection informations -  GC 0,1,2 , Large heap collections and sizes. 
    Thread informations - Number of live threads and their stack traces.

    So, all the above informations (memory and threads) i am trying to take regularly , store it and process them to show to the user. 

    I use the same profiling API(that i used for IL rewriting) with different event masks to collect respective metrics. 

    I receive callbacks for object allocations and class loaded and GC events. At runtime i store the above information(example:objectIDs , classIDs,) in memory (guess it is a wrong approach) 

    But i get some unacceptable amount of overhead in the profiled application. 

    I also tried with some other existing CLR memory profilers in market. They dint have much overhead. They have option for taking snapshot .

    How can i achieve this snapshot sort of thing in CLR profiler (using profiling API). Or is there any other efficient way(without snapshot) to achieve this?

    • Edited by Selva VS Wednesday, May 10, 2017 10:31 AM
    Wednesday, May 10, 2017 10:06 AM

All replies