Sunday, June 16, 2013

Performance Monitor – Windows Application

The Windows Performance Monitor is a general purpose performance monitoring tool which can be used to monitor performance of windows and web applications. The tool can be customized to monitor specific parameters like Memory Utilization, CPU Utilization, Disk I/O etc of the system at any given point of time or over a specific time interval.

In this post we shall see on how to use the Performance Monitor tool monitor performance of a Windows application based on memory utilization of the application. This is just one of the counters, there a hundreds of such counters which can be used to measure various parameters of the application.

To measure the memory utilization of the application, use the following steps to configure the Performance Counter.

1. Open the Performance Monitor tool.
2. In the left navigation tree, expand Monitoring Tools, and then click Performance Monitor
3. The default counter starts running.
4. Delete the default counter by clicking the Delete (x) icon in the toolbar.
5. Click on the Add (+) icon to add a new Counter
6. In the popup select the Local Computer or the computer to be monitored
7. In the categories list, open the .Net CLR Memory group and select the following parameters
      #Total Reserve Bytes
      # of Sync blocks in use
      Allocated Bytes / sec

8. Under Instances list select the application which you want to monitor
9. Click the Add button to add the selected parameters to the new Counter
10. Click OK to close the settings window, and the new counter starts running automatically.

Allow the counter to run, and start working on the application. In this case we are trying to measure the parameters which determine the memory utilization of the application. Once you start using the application you can start seeing spiked in the Graph, this indicates that application has started consuming memory.

If you see a high spike while calling an event or a method, you can check the code of the method to validate the cause of the spike, rectify the issue and re-run the counter, you should be able to see the improvements due to the fix you did.

The following is the screen shot of the counter, output as displayed in a Line Graph.

Search Flipkart Products:

No comments: