What is the .NET equivalent for java -verbose: gc command line option

I am writing an ASP.NET MVC application and I see the seemingly random performance from one of my actions. My initial step is that garbage collection comes into play and pauses the application for a while, but I cannot find a button / switch that will prove or disprove my theory.

None of the java users there -verbose:gc is a command line switch that you can pass to a Java application that will print the JVM when the GC event occurs and how long it takes.

I tried to use the performance tool vs2010 and JetBrains dotTrace, both of which are a bit like using a thermonuclear weapon to crack a small nut.

+6
java performance garbage-collection c #
source share
2 answers

.NET 4.0 has an event trace for Windows (ETW) that provides you with the information you are looking for. Here is one of them for the GC .

FYI ETW is very fast and integrated into the core. With ETW you should be able to get this information. alt text

alt text

And to get this information, there is a tool from the BCL team called PerfMonitor

Below are the steps for using the tool to get GC information.

  • Run cmd or powershell as admin, this is necessary to collect ETW tracking
  • Launch the app you want to track
  • Run the command "PerfMonitor.exe / process: 4180 start", where 4180 is the process identifier
  • Perform necessary actions
  • Then print "PerfMonitor.exe stop"
  • The command to get the report "PerfMonitor.exe GCTime". This will create a report and open it in a browser.

I also have a blog about the same

NTN

+6
source share

Your first guess should not be GC. With all the normal workloads, you don't notice the GC in .NET.

There is no trace switch for the GC, but you can look at performance counters if you still think the GC is to blame.

0
source share

All Articles