memory profiling visual studio 2013

  1. Windows Performance Monitor

I tried visual studio ultimate performance and diagnostics, and ran the app and put the load, but when it compiled the report it showed only the CPU Utlization over time and NOT net memory allocation, which is what i want…

This guy here refers to according to which:

To collect .NET memory data

  1. In Performance Explorer, right-click the performance session, and then click Properties.
  3. On the Performance SessionProperty Pages dialog box, click the General tab, and select the Collect .NET object allocation information check box.
  4. To collect .NET object lifetime data, select the Also collect .NET object lifetime information check box.

but this still doesn’t show me the trend..what i want is the private byte performance counter data for this app pool. But going to perfmon and setting things up is a hassle.

Hence i’m trying to do it from VS only.

Finally found this:

On the Windows Counters page, specify one or more operating system performance counters to add to the profiling data as marks.

To collect Windows counter data

  1. In Performance Explorer, right-click the session for which you want to configure Windows counters and select Properties.
  2. In the Property Pages, click Windows Counters.
  3. Select the Collect Windows Counters check box.
  4. In the Collection interval (msecs) text box, type a time interval.
  5. Select a category from the Counter Category drop-down list.
  6. Select an instance from the Instance drop-down list.
  7. Select the counters you want to use when you profile your application.
  8. Click Apply.

i’ve set these counters specifically to detect memory leaks:

his troubleshooter will help you to identify the cause of native memory leak in an IIS application pool. It’s important to keep in mind that it is normal for high memory allocation as a web application serves requests. However, if you consistently see both Process\Private Bytes and Process\Virtual Bytes are increasing or Process\Private Bytes and Process\Working Set are increasing and Memory\Available Bytes is decreasing, the memory leak will occur and it may cause an out-of-memory exception.

turns out that you cannot plot chart for the data collected, so i’m exporting it to csv and then plotting on excel.Steps:

1. Once profiling is stopped, change current view to “Marks”

2. Then export data as csv ( clk on export report data filter and then select marks)

3. Open it in excel and plot the desired chart


  1. On analysis i found that the private bytes is not really the Total Memory allocated to the process. This thing confirms that:



IIS 7 auto suspends app when no request

One of my services hosted on IIS Should ideally be a windows service, coz it just does processing. The reason for hosting it on IIS is that it exposes a webAPI for stats and start/stop processing actions.

Now, the problem is that we don’t query the svc for stats often, and so IIS is suspending the app, which is suspending the ongoing processing that we want.

Turns out there’s an Idle Timeout setting on IIS that causes the process to suspend:

I want to disable this.

Percentile Analysis

The 90th percentile is the value for which 90% of the data points are smaller

The 90th percentile is a measure of statistical distribution, not unlike the median. The median is the middle value. The median is the value for which 50% of the values were bigger, and 50% smaller. The 90th percentile tells you the value for which 90% of the data points are smaller and 10% are bigger.

Statistically, to calculate the 90th percentile value:
1. Sort the transaction instances by their value.
2. Remove the top 10% instances.
3. The highest value left is the 90th percentile.

in Splunk, do it like this:

There are ten instances of transaction “t1” with the values 1,3,2,4,5,20,7,8,9,6 (in sec).
1. Sort by value — 1,2,3,4,5,6,7,8,9,20.
2. Remove top 10 % — remove the value “20.”
3. The highest value left is the 90th percentile — 9 is the 90th percentile value.