CLR Profiler and the WebDev Server

CLR Profiler for the .NET Framework 2.0 is available for download.

The profiler is a good tool to use when you want to find out what’s happening in memory. For instance, ASP.NET developers using InProc sessions state are always curious about how much memory they are using. Assuming the web project is file system based, the first step is to get CLR Profiler to work with the development web server: WebDev.WebServer.exe.

The profiler can’t attach to a running process, so you have to tell the profiler how to launch the web server. WebDev requires at least two parameters: a port number (/port), and a physical path (/path) to the web application. Once profiler is running, you can use the File -> Set Parameters menu option and enter these parameters. The command line parameters together will look like /port:2112 /path:”c:\src\webapp1”.

With parameters set, you can launch the web server by clicking “Start Application” in the profiler form and browse to WebDev.WebServer.exe in the framework installation directory (typically \Windows\Microsoft.NET\Framework\v2.0.xxxx). The server icon will appear in the tray, where you can right click the icon and select “Open in Web Browser”. The application might feel sluggish during profiling.

While interacting with the web application you can press “Show Heap Now” to view a heap graph. A heap graph can be a busy looking diagram, but you can filter the view. For instance, to see what’s hanging around in session state, right click the graph and choose “Filter”. Enter “System.Web.SessionState” to filter the types, and you’ll be able to see the type and size of objects in session.

The CLRProfiler.doc file included with the tool contains a solid tutorial on using and interpreting profiler results. The document is worth a read, even if you don’t plan on using the tool right away. Someday it might come in handy.

posted on Sunday, December 11, 2005 10:59 PM by scott

Comments

Monday, December 12, 2005 8:03 PM by Christopher Steen

# Link Listing - December 12, 2005

CLR Profiler and the WebDev Server [Via: scott ]
DHTML IV: Highlighting a table row or column [Via:...
Wednesday, December 14, 2005 10:20 AM by scott

# re: CLR Profiler and the WebDev Server

Hannes: I'm not quite sure what to make of the error message. What is it you are trying to do when the exception occurs?
Saturday, December 17, 2005 10:45 PM by Dinis Cruz @ Owasp .Net Project

# Firefox Tabs Dump }




ASP.NET Podcast Show
#30 - Minimizing the ASP.NET ViewState Part #2

"Insisting on absolute...
Saturday, December 17, 2005 10:52 PM by Dinis Cruz @ Owasp .Net Project

# FireFox Tab's Dump [18 Dec 05]


"Insisting on absolute
safety is for people who don't have the balls to live in the real
world."...
Saturday, December 17, 2005 10:52 PM by Dinis Cruz @ Owasp .Net Project

# Firefox Tabs Dump }




ASP.NET Podcast Show
#30 - Minimizing the ASP.NET ViewState Part #2

"Insisting on absolute...
Tuesday, December 27, 2005 7:59 AM by Technical Notes

# ASP.NET Links, Resources and How Tos via Scott Guthrie

For those looking to stay abreast of ASP.NET development, I highly recommend following Scott Guthrie's...
Monday, March 27, 2006 3:56 AM by dinesh

# re: CLR Profiler and the WebDev Server

I am working on a CRM product which is very huge.CLR Profiler is cool but sometimes I get lost in the heaps of information that it gives I think ProfileSharp, .NET code,memory and performance profiler is the best in the market.The developer edition is free and it is supposedly the only code profiler in the market that is free.The Enterprise Edition is even better.
Monday, March 27, 2006 4:29 AM by scott

# re: CLR Profiler and the WebDev Server

Sounds good, Dinesh. I'll have to try it out.