<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Amol Ravande's Performance blog</title><link>http://blogs.msdn.com/amolravande/default.aspx</link><description>Go Faster, Stronger and Higher</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How to: Create a web test plug-in to extract and store an array of values using Visual Studio Team system</title><link>http://blogs.msdn.com/amolravande/archive/2009/02/27/how-to-create-a-web-test-plug-in-to-extract-and-store-an-array-of-values-using-visual-studio-team-system.aspx</link><pubDate>Fri, 27 Feb 2009 11:21:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9448295</guid><dc:creator>amolravande</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/amolravande/comments/9448295.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amolravande/commentrss.aspx?PostID=9448295</wfw:commentRss><description>&lt;p&gt;&lt;b&gt;Applies to&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;· Microsoft® Visual Studio® Team System&lt;/p&gt;  &lt;p&gt;· Performance Testing&lt;/p&gt;  &lt;p&gt;· Web Testing&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;This article explains how to create a web test plug-in to automate scenarios where the numbers of form post parameters for a web request are dynamic in nature. The web test plug-in is a custom extraction rule which extracts a required set of values and stores it in an array. The plug-in is a library (DLL file) that can be reused by adding a reference in your web test project. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Contents &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;· Objectives&lt;/p&gt;  &lt;p&gt;· Overview&lt;/p&gt;  &lt;p&gt;· Example scenario&lt;/p&gt;  &lt;p&gt;· Summary of steps&lt;/p&gt;  &lt;p&gt;· Resources&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Objectives: &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;· Learn how to create your own web test plug-in&lt;/p&gt;  &lt;p&gt;· Learn when and how to use this web test plug-in&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Overview: &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Simulating virtual user load on the web application is one of the key approaches used in Performance Testing. Creating the required virtual user load requires an engineer to create scripts that automate user actions. Visual studio team system helps you create scripts with ease with the help of its record – playback feature and the dynamic correlation feature added newly in Visual Studio Team System 2008. The Dynamic correlation feature identifies the dynamic Form Post or Query String values and automatically binds them, however when the number of form post parameters for a web request change dynamically, an engineer would have to write a custom plug-in to handle such a case.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Example Scenario: &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Consider a page with a drop down, a view button and a submit button. Now a user selects an item from the drop down and clicks on view. This displays a set of items on the page depending on how many items are associated with it. Each of these items is associated with a checkbox. The user needs to select all the checkbox and hit on the submit button. Below is snapshot taken from the HTTP watch tool showing the POST data on hitting the submit button. Each of these form post parameters represent a check box selected. When the user wants to select all and submit, the number of form post parameters sent to the server change with initial item selected from the drop down. Also we cannot simply create an extraction rule since we do not know what drop down item the user would select and how many values needs to be extracted.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/HowtoCreateawebtestplugintoextractandsto_C1E4/image_2.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="302" alt="image" src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/HowtoCreateawebtestplugintoextractandsto_C1E4/image_thumb.png" width="637" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Summary of steps:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;1) Create a web test plug-in&lt;/p&gt;  &lt;p&gt;2) Add the web test plug-in&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Step 1: Create a web test plug-in&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;a) Create a new project and choose a class library template. &lt;/p&gt;  &lt;p&gt;b) Add a reference to Microsoft.VisualStudio.QualityTools.WebTestFramework.dll&lt;/p&gt;  &lt;p&gt;c) Create a class that inherits the ExtractionRule class. The ExtractionRule class lies in the Microsoft.VisualStudio.TestTools.WebTesting namespace. Make use of this namespace in your class library.&lt;/p&gt;  &lt;p&gt;d) In the above example shown, each of these form post parameters follow a particular pattern hence a regular expression can be used. &lt;/p&gt;  &lt;p&gt;e) Create a string private property. This would be used to set and get the user input in the form of a regular expression.&lt;/p&gt;  &lt;p&gt;f) Override the Extract method. The code in this method does the core functionality of the custom extraction rule. In this method content from response body is extracted based on the regular expression and stored in a list. This list is then added to the web test context.&lt;/p&gt;  &lt;p&gt;g) Build this project and a DLL would be created.&lt;/p&gt;  &lt;p&gt;The final code of the plug-in should look something like this&lt;/p&gt;  &lt;p&gt;using System;&lt;/p&gt;  &lt;p&gt;using System.Collections.Generic;&lt;/p&gt;  &lt;p&gt;using System.Linq;&lt;/p&gt;  &lt;p&gt;using System.Text;&lt;/p&gt;  &lt;p&gt;using Microsoft.VisualStudio.TestTools.WebTesting;&lt;/p&gt;  &lt;p&gt;using System.Text.RegularExpressions;&lt;/p&gt;  &lt;p&gt;namespace ExtractRegex&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;public class ExtractRegex : ExtractionRule&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;{&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;private string regularexpression;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;public string MyRegularExpression&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;{&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;get&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;{&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return this.regularexpression;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;set&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;{&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this.regularexpression = value;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;public override void Extract(object sender, ExtractionEventArgs e)&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;{&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; List&amp;lt;String&amp;gt; lst = new List&amp;lt;String&amp;gt;();&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Regex rg = new Regex(MyRegularExpression);&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MatchCollection mcoll=rg.Matches(e.Response.BodyString, 0);&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; for (int i = 0; i &amp;lt; mcoll.Count; i++)&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lst.Add(mcoll[i].ToString());&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; e.WebTest.Context.Add(this.ContextParameterName, lst);&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Step 2: Add the web test plug-in to the recorded web test&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;a) Create a web test for a given user scenario by using the record and playback functionality of Visual Studio Team System.&lt;/p&gt;  &lt;p&gt;b) Add a reference to the DLL created for the plug-in project. &lt;/p&gt;  &lt;p&gt;c) Taking a look at the HTTP traffic for the user scenario through HTTP watch tool, we would see that all the form post parameters would be built by extracting certain values from the response body. &lt;/p&gt;  &lt;p&gt;d) Choose the request whose response needs to be extracted. Right click and select add extraction rule. A new custom rule ExtractRegex will be seen as shown below.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/HowtoCreateawebtestplugintoextractandsto_C1E4/image_4.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="341" alt="image" src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/HowtoCreateawebtestplugintoextractandsto_C1E4/image_thumb_1.png" width="437" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;a) Specify the Context Parameter Name and the Regular Expression to extract. In this case we shall specify “newMajorVersionGrid:_ctl[0-9]*:selectEditCheckBox” for the regular expression and “MyModules” as the context parameter name. &lt;/p&gt;  &lt;p&gt;b) Convert your web test to a coded web test by right clicking on the web test name and selecting “generate code”&lt;/p&gt;  &lt;p&gt;c) In the coded web test, identify the request which requires us to build the form post parameters. The extracted values are already stored in the current web test context. These values can be obtained by iterating through the web test context variable. The entire web test request will look as stated below. The highlighted code shows how the form post parameters have been built.&lt;/p&gt;  &lt;p&gt;WebTestRequest request6 = new WebTestRequest(&amp;quot;https://acetesting/AddNewMajorVersion.aspx&amp;quot;);&lt;/p&gt;  &lt;p&gt;request6.Method = &amp;quot;POST&amp;quot;;&lt;/p&gt;  &lt;p&gt;request6.Headers.Add(new WebTestRequestHeader(&amp;quot;Cookie&amp;quot;, &amp;quot;GPLocale=1033;&amp;quot;));&lt;/p&gt;  &lt;p&gt;FormPostHttpBody request6Body = new FormPostHttpBody();&lt;/p&gt;  &lt;p&gt;request6Body.FormPostParameters.Add(&amp;quot;productLineDropDown&amp;quot;, &amp;quot;24&amp;quot;); request6Body.FormPostParameters.Add(&amp;quot;existingMajorVersionDropDown&amp;quot;, &amp;quot;6&amp;quot;); request6Body.FormPostParameters.Add(&amp;quot;newMajorVersionDropDown&amp;quot;, &amp;quot;7&amp;quot;);&lt;/p&gt;  &lt;p&gt;foreach (string s in (List&amp;lt;string&amp;gt;)this.Context[&amp;quot;MyModules&amp;quot;])&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;p&gt;request6Body.FormPostParameters.Add(s, &amp;quot;on&amp;quot;);&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;request6Body.FormPostParameters.Add(&amp;quot;cloneRelationshipCheckbox&amp;quot;, &amp;quot;on&amp;quot;);&lt;/p&gt;  &lt;p&gt;request6Body.FormPostParameters.Add(&amp;quot;cloneAvailability&amp;quot;, &amp;quot;on&amp;quot;);&lt;/p&gt;  &lt;p&gt;request6Body.FormPostParameters.Add(&amp;quot;saveNewMajorVersionButton&amp;quot;, &amp;quot;Save&amp;quot;);&lt;/p&gt;  &lt;p&gt;request6.Body = request6Body;&lt;/p&gt;  &lt;p&gt;yield return request6;&lt;/p&gt;  &lt;p&gt;request6 = null;&lt;/p&gt;  &lt;p&gt;d) Run and validate your web test.&lt;/p&gt;  &lt;p&gt;Just like the current approach makes use of regular expression as a user input, a similar procedure/methodology can be applied to create plug-ins with various input parameters such as HTMLAtrribute, HTML tags, StartsWith and EndsWith Text etc.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9448295" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/amolravande/archive/tags/Web+Testing/default.aspx">Web Testing</category><category domain="http://blogs.msdn.com/amolravande/archive/tags/Web+Test+Plug-ins/default.aspx">Web Test Plug-ins</category></item><item><title>Debugging OutOfMemoryExceptions in managed code using Windbg</title><link>http://blogs.msdn.com/amolravande/archive/2008/12/16/debugging-outofmemoryexceptions-in-managed-code-using-windbg.aspx</link><pubDate>Tue, 16 Dec 2008 20:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9226820</guid><dc:creator>amolravande</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/amolravande/comments/9226820.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amolravande/commentrss.aspx?PostID=9226820</wfw:commentRss><description>&lt;P&gt;Before you start debugging make sure you have the symbols path set appropriately. Below link shows you how to configure symbol path&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/johan/archive/2007/11/13/getting-started-with-windbg-part-i.aspx"&gt;http://blogs.msdn.com/johan/archive/2007/11/13/getting-started-with-windbg-part-i.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Once you have the right dump with you open the crash dump through windbg and load sos.dll using the command &lt;STRONG&gt;&lt;U&gt;.load sos&lt;/U&gt;&lt;/STRONG&gt;. Windbg by default will show the native stack and for you to look into managed stack sos.dll is required to be loaded.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/SOS.jpg" mce_href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/SOS.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=56 alt=SOS src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/SOS_thumb.jpg" width=244 border=0 mce_src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/SOS_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The next thing I need to determine is whether the leak is in managed heap or unmanaged heap. Type in the command &lt;STRONG&gt;&lt;U&gt;!eeheap -gc. &lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/eeheap.jpg" mce_href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/eeheap.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=268 alt=eeheap src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/eeheap_thumb.jpg" width=270 border=0 mce_src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/eeheap_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;As you can see in the above snapshot, out of the total dump size of 1.2 GB, the GC heap size is 1.15 GB which clearly indicates the leak is in managed code. &lt;/P&gt;
&lt;P&gt;Now I do a &lt;STRONG&gt;&lt;U&gt;!dumpheap -stat&lt;/U&gt;&lt;/STRONG&gt; to give the overall summary of space usage of .NET objects. This shows System.Byte[] to be the largest consumer of memory(786 MB)&amp;nbsp;as shown below.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/dumpheap.jpg" mce_href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/dumpheap.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=160 alt=dumpheap src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/dumpheap_thumb.jpg" width=372 border=0 mce_src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/dumpheap_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Lets try to dump some of the System.Byte[] objects using &lt;STRONG&gt;&lt;U&gt;!dumpheap -type System.Byte[]&amp;nbsp;&lt;/U&gt;&lt;/STRONG&gt; to get the object addresses.&amp;nbsp;Next thing we need to determine is what is causing this objects to stay alive and not get garbage collected in other words we need to&amp;nbsp;find out&amp;nbsp;the references of these objects. Run the &lt;STRONG&gt;&lt;U&gt;!gcroot &amp;lt;address&amp;gt;&lt;/U&gt;&lt;/STRONG&gt; command on one of the System.Byte[] objects consuming highest memory.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/!gcroot_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/!gcroot_2.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: 484px; HEIGHT: 118px; BORDER-RIGHT-WIDTH: 0px" height=95 alt=!gcroot src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/!gcroot_thumb_2.jpg" width=442 border=0 mce_src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/!gcroot_thumb_2.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I checked the code and the only suspect here looked like OperationContextScope. This class implemented the idisposable interface and was instantiated several times in the code and never being disposed off. To confirm that OperationContextScope was indeed the culprit I tried to figure out the total memory usage of this object. In order to do that you need to get the methodtable address of it. Use the command !name2ee &amp;lt;assemblyname&amp;gt; &amp;lt;Object&amp;gt;. In this case I typed in &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;!name2ee System.ServiceModel.dll System.ServiceModel.OperationContextScope&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/name2ee.jpg" mce_href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/name2ee.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=93 alt=name2ee src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/name2ee_thumb.jpg" width=513 border=0 mce_src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/name2ee_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;A method table contains all the objects instances of a particular type(OperationContextScope), so the next i did was to dump the method table to get all the object addresses for OperationContextScope.&lt;/P&gt;
&lt;P&gt;Type in &lt;STRONG&gt;&lt;U&gt;!dumpheap -mt 5094bf84&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/dumpheapmt.jpg" mce_href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/dumpheapmt.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=216 alt=dumpheapmt src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/dumpheapmt_thumb.jpg" width=313 border=0 mce_src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/dumpheapmt_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I tried to find the size&amp;nbsp;of some of the objects using &lt;STRONG&gt;&lt;U&gt;!objsize &amp;lt;address&amp;gt;&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp;and found that they were in the range of 20-60 MB and they totalled upto 750 MB and there were many more smaller objects still alive. This confirmed that &lt;STRONG&gt;OperationContextScope&lt;/STRONG&gt; object was indeed the cause of OutOfMemoryException and needs to be disposed as soon as it is done using with.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/objectsize.jpg" mce_href="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/objectsize.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=246 alt=objectsize src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/objectsize_thumb.jpg" width=424 border=0 mce_src="http://blogs.msdn.com/blogfiles/amolravande/WindowsLiveWriter/DebuggingOutOfMemoryExceptionsinmanagedc_11C25/objectsize_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9226820" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/amolravande/archive/tags/WinDbg/default.aspx">WinDbg</category><category domain="http://blogs.msdn.com/amolravande/archive/tags/OutOfMemoryException/default.aspx">OutOfMemoryException</category><category domain="http://blogs.msdn.com/amolravande/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Troubleshooting SQL Deadlocks with Read Committed Isolation using Row versioning</title><link>http://blogs.msdn.com/amolravande/archive/2008/11/17/troubleshooting-sql-deadlocks-with-read-committed-isolation-using-row-versioning.aspx</link><pubDate>Mon, 17 Nov 2008 15:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9109751</guid><dc:creator>amolravande</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/amolravande/comments/9109751.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amolravande/commentrss.aspx?PostID=9109751</wfw:commentRss><description>&lt;P&gt;&lt;STRONG&gt;Background&lt;/STRONG&gt; : SQL server 2005 introduces a new isolation level called the row versioning with Read Committed Snapshot. This setting is useful in case where there are reader-writer conflicts only. With this setting on, SQL server maintains versions of each row of data in tempdb. Readers do not acquire a shared lock on the data being read and hence helps update operations to take place without any blocking. While reading the engine retreives the most recent committed version of the row.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;How to&lt;/STRONG&gt; : Enabling Read Committed Isolation using row-versioning is a simple database level configuration setting. Use the below statement to turn it on&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ALTER DATABASE MyDatabase SET READ_COMMITTED_SNAPSHOT ON&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Case Study&lt;/STRONG&gt; : In one of the recent engagements, we had a situation where several SQL deadlocks would occur under load which would eventually show up as an error in the event viewer on the web server causing the end user workflow to fail. Looking at the Deadlock graph in the SQL profiler it was found that the deadlocks were due to reader writer conflicts. We tested the application both with the default Read Committed and Read Committed Snapshot on for the same workload to see if it would eliminate deadlocks. The testing results looked pretty impressive as shown below.&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=400 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=200&gt;READ_COMMITTED&lt;/TD&gt;
&lt;TD class="" vAlign=top width=200&gt;READ_COMMITTED_SNAPSHOT&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=200&gt;6 deadlocks within 30 minutes&lt;/TD&gt;
&lt;TD class="" vAlign=top width=200&gt;&lt;STRONG&gt;0 deadlocks within an hour&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;Also the interesting fact about this feature is that it can be enabled without effecting the application.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Tradeoffs&lt;/STRONG&gt; : As always, there are certain tradeoffs of setting this option on.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;1) Impacts read performance due to chains of row versions&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;2) Impacts update performance &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;3) Increases Tempdb space usage.&lt;/P&gt;
&lt;P&gt;Consider testing your application to check for&amp;nbsp; the performance impact of turning this setting on.&lt;/P&gt;
&lt;P&gt;PS :&amp;nbsp;Thanks to my collegues &lt;A class="" title="Jimmy may" href="http://blogs.msdn.com/jimmymay" mce_href="http://blogs.msdn.com/jimmymay"&gt;Jimmy May&lt;/A&gt; and Eddie lau for their help&amp;nbsp;on this one&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9109751" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/amolravande/archive/tags/SQL+Performance/default.aspx">SQL Performance</category><category domain="http://blogs.msdn.com/amolravande/archive/tags/Deadlocks/default.aspx">Deadlocks</category></item><item><title>Improving application Start up time: GeneratePublisherEvidence setting in Machine.config</title><link>http://blogs.msdn.com/amolravande/archive/2008/07/20/startup-performance-disable-the-generatepublisherevidence-property.aspx</link><pubDate>Sun, 20 Jul 2008 20:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8758996</guid><dc:creator>amolravande</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/amolravande/comments/8758996.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amolravande/commentrss.aspx?PostID=8758996</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Background&lt;/B&gt; : When assemblies are authenticode signed, the signed assemblies need to be verified by the certificate authority. When CA certificate is not present on the same machine the assemblies require network or internet access. If the signed assemblies are installed on machine where CA certificate is not on the same machine and does not have network/internet access the .NET thread might timeout waiting to connect. Below is one case study I have presented. There are other ways to avoid this performance issue including performing strong name signing of assemblies, placing the CA certificate on the same machine &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;How to &lt;/B&gt;: Use the following setting in the Machine.config in the runtime tag&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 36pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;configuration&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;runtime&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;B style="mso-bidi-font-weight: normal"&gt;generatePublisherEvidence enabled="false"&lt;/B&gt;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/runtime&amp;gt;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;/configuration&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Case study &lt;/B&gt;: In a recent engagement, the site home page took ~54 seconds to load on IIS reset. As usual, looking into the resource usage pattern(CPU,IO and memory) we didn’t find anything alarming. The best solution was to get a memory dump of the worker process(w3wp.exe) during this time and analyse to see what was going on. Looking at the memory dump and analysing each thread, one thread seemed worth looking into. Looking into the thread stack given below we observed that .NET assembly’s security was being checked and &lt;SPAN lang=EN-US style="mso-ansi-language: EN-US"&gt;call was being made to verify the certificate revocation list. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0b550 000007fe`faf12e58 cryptnet!CryptRetrieveObjectByUrlWithTimeout+0x263&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0b850 000007fe`faf145fa cryptnet!CryptRetrieveObjectByUrlW+0x20c&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0ba40 000007fe`faf1b826 cryptnet!RetrieveObjectByUrlValidForSubject+0x14a&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0bb70 000007fe`faf141cb cryptnet!RetrieveTimeValidObjectByUrl+0x2de&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0bc60 000007fe`faf128b0 cryptnet!CTVOAgent::GetTimeValidObjectByUrl+0x2e3&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0bdc0 000007fe`faf124dd cryptnet!CTVOAgent::GetTimeValidObject+0x7cc&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0bf90 000007fe`faf115a4 cryptnet!FreshestCrlFromCertGetTimeValidObject+0x61&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c000 000007fe`faf1b6e3 cryptnet!CryptGetTimeValidObject+0xb0&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c080 000007fe`faf1233d cryptnet!GetTimeValidCrl+0x4bb&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c1c0 000007fe`faf1201e cryptnet!GetBaseCrl+0x7d&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c250 000007fe`faf11e24 cryptnet!MicrosoftCertDllVerifyRevocation+0x238&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c3a0 000007fe`fcc06143 cryptnet!CertDllVerifyRevocation+0x28&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c3f0 000007fe`fcc0629c crypt32!VerifyDefaultRevocation+0x398&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c4e0 000007fe`fcc066bd crypt32!CertVerifyRevocation+0x144&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c5e0 000007fe`fcc063fa crypt32!CChainPathObject::CalculateRevocationStatus+0x48d&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c710 000007fe`fcbeccc8 crypt32!CChainPathObject::CalculateAdditionalStatus+0x2e2&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c7a0 000007fe`fcbec86b crypt32!CCertChainEngine::CreateChainContextFromPathGraph+0x443&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c920 000007fe`fcbebf32 crypt32!CCertChainEngine::GetChainContext+0x8b&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0c9e0 000007fe`fb9246b8 crypt32!CertGetCertificateChain+0x100&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0ca80 000007fe`fb92445a wintrust!_WalkChain+0x2b4&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0cb50 000007fe`fb921e47 wintrust!WintrustCertificateTrust+0xea&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0cbc0 000007fe`fb921057 wintrust!_VerifyTrust+0x347&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0cde0 00000642`ffaf8031 wintrust!WinVerifyTrust+0x70&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0ce20 00000642`7f862c5f mscorsec!GetPublisher+0x139&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'MS Sans Serif'; mso-ansi-language: EN-US"&gt;00000000`03a0cf40 00000642`7f57710b mscorwks!PEFile::CheckSecurity+0x40df57&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-ansi-language: EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-language: EN-US; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: Calibri; mso-ansi-language: EN-IN; mso-bidi-language: AR-SA; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi"&gt;On checking with the developer again we found that the server did not have access to the internet and the assemblies were authenticode signed. Since there was no internet access .NET thread would wait to connect and ultimately timeout without doing the security check. We enabled the setting as shown above. Boom!!!! The problem was fixed and the overall home page load time on iisreset came down from ~54 seconds to ~10 seconds.&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8758996" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/amolravande/archive/tags/Startup+performance/default.aspx">Startup performance</category></item><item><title> Improving Application performance over WAN</title><link>http://blogs.msdn.com/amolravande/archive/2008/06/16/here-we-go-again-improving-application-performance-over-wan.aspx</link><pubDate>Mon, 16 Jun 2008 12:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8603982</guid><dc:creator>amolravande</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/amolravande/comments/8603982.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amolravande/commentrss.aspx?PostID=8603982</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;U&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;Situation&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;: The web application hosted on a server in India is performing well for end users in India. But the users in Europe are having a tough time accessing the web pages due to extremely slow response times. How would you reduce the risk considering you don’t have enough budgets to&amp;nbsp;have a geographically distributed network to support your end users and keep them happy? &lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; FONT-FAMILY: Wingdings; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;U&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;Solution:&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt; Two most important things to note that helps improve perf over WAN is: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 72pt; TEXT-INDENT: -18pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l2 level1 lfo2"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; FONT-FAMILY: Wingdings; mso-fareast-language: EN-IN; mso-bidi-font-family: Wingdings; mso-themecolor: text2; mso-fareast-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;ü&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri&gt;Minimize the overall data transfer between web server and the client.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0cm 0cm 10pt 72pt; TEXT-INDENT: -18pt; LINE-HEIGHT: normal; mso-add-space: auto; mso-list: l2 level1 lfo2"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; FONT-FAMILY: Wingdings; mso-fareast-language: EN-IN; mso-bidi-font-family: Wingdings; mso-themecolor: text2; mso-fareast-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;ü&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri&gt;Minimize the number of HTTP requests for each user action.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri&gt;Here are some of my favourite tips and tricks to enable your app perform in the above mentioned manner. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 13pt; COLOR: #1f497d; FONT-FAMILY: Wingdings; mso-fareast-language: EN-IN; mso-bidi-font-family: Wingdings; mso-themecolor: text2; mso-fareast-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;ü&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 13pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;HTTP Compression: &lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;Reduces the overall data transferred between web server and the client by compressing static/dynamic pages. &lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 13pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 13pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri&gt;The link below shows how to enable static and dynamic compression.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;A href="http://technet.microsoft.com/en-us/magazine/cc160755(TechNet.10).aspx" mce_href="http://technet.microsoft.com/en-us/magazine/cc160755(TechNet.10).aspx"&gt;&lt;FONT face=Calibri&gt;http://technet.microsoft.com/en-us/magazine/cc160755(TechNet.10).aspx&lt;/FONT&gt;&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri&gt;Note: Enabling Compression for dynamic pages slightly increases the overall CPU utilization on the web server and this depends from app to app. Hence the application has to be thoroughly tested in order to maintain a right balance. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 13pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; FONT-FAMILY: Wingdings; mso-fareast-language: EN-IN; mso-bidi-font-family: Wingdings; mso-themecolor: text2; mso-fareast-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;ü&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 13pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;Use Pagination&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;: Consider displaying data records on a page by page basis to reduce the data transferred for a single user action. For example, get only 10 records at a time instead of fetching everything. Also, consider fetching only the required columns for each record from the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; FONT-FAMILY: Wingdings; mso-fareast-language: EN-IN; mso-bidi-font-family: Wingdings; mso-themecolor: text2; mso-fareast-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;ü&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 13pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;Enable Content Expiration&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This helps in reducing the unnecessary 304 round trips from client to the web server. This might be only useful for sites where static content do not change too frequently(at least a day)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; LINE-HEIGHT: 115%; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;So how does this work? Consider a page whose static content is already cached on the client. Whenever the browser requests that page, it checks to see if there is any change in static content on the server. If there is no change then the request returns with HTTP status code 304 and the browser takes the content directly from the cache. Hence, in order to reduce these unnecessary 304 round trips and to prevent the browser from checking for any change on the server we set content expiration on static content for a particular duration depending on the type of web application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; LINE-HEIGHT: 115%; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri&gt;See the following on how to enable content expiration. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri&gt;http://support.microsoft.com/kb/311006&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; LINE-HEIGHT: normal; mso-list: l1 level1 lfo3"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; FONT-FAMILY: Wingdings; mso-fareast-language: EN-IN; mso-bidi-font-family: Wingdings; mso-themecolor: text2; mso-fareast-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;ü&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 13pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;Image Clustering&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;: Consider combining smaller images into one image wherever feasible to reduce the number of HTTP request made to the server. Also several java scripts can be combined together instead of fetching them separately from the web server. &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; LINE-HEIGHT: normal; mso-list: l1 level1 lfo3"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0cm 0cm 10pt 36pt; TEXT-INDENT: -18pt; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; FONT-FAMILY: Wingdings; mso-fareast-language: EN-IN; mso-bidi-font-family: Wingdings; mso-themecolor: text2; mso-fareast-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;ü&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 13pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;Enable Connection Keep-Alive&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;: This allows the web server to keep the connection open to the client. Hence the client can download multiple files without any hassles of opening and closing the connections each time. Although this option is enabled by default in IIS 6.0 it is always better to check for it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; LINE-HEIGHT: normal; mso-list: l1 level1 lfo3"&gt;&lt;o:p&gt;&amp;nbsp;Hope you like this post :)&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0cm 0cm 10pt 36pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-language: EN-IN; mso-bidi-font-family: 'Times New Roman'; mso-themecolor: text2; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-IN; mso-bidi-language: AR-SA"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8603982" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/amolravande/archive/tags/WAN/default.aspx">WAN</category><category domain="http://blogs.msdn.com/amolravande/archive/tags/Frontend/default.aspx">Frontend</category></item><item><title>Need for speed:Loop performance</title><link>http://blogs.msdn.com/amolravande/archive/2007/09/15/need-for-speed-loop-performance.aspx</link><pubDate>Sat, 15 Sep 2007 16:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4928033</guid><dc:creator>amolravande</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/amolravande/comments/4928033.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amolravande/commentrss.aspx?PostID=4928033</wfw:commentRss><description>&lt;DIV&gt;For those guys who havent heard about Loop unrolling here is a brief description about it. Loop unrolling is a way of optimizing the code by manipulating the iteration variable in the body of the loop thus reducing the number of checks each time the loop is iterated. Consider this following code.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(int i=0;i&amp;lt;100;i++)&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myfunc();&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;If you try to convert this code to assembly language you would see around half of the instructions were due to the loop overhead(i.e for&amp;nbsp; conditional branches and jumps). Hence&amp;nbsp;to optimize this, I would change it to&lt;/DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(int i=0;i&amp;lt;100;)&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myfunc();i++;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myfunc();i++;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myfunc();i++;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myfunc();i++;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/DIV&gt;
&lt;DIV&gt;This reduces the number of conditional branches and loops to 1/5th and hence reduces the overhead. Infact there are some compilers that perform loop unrolling. The Intel C/C++ compiler for linux gives you an option to specify at compile time the number of times the loop has to be unrolled. However the amount of&amp;nbsp;loop unrolling and operations&amp;nbsp;inside the loop body has to be carefully chosen. More unrolling may lead to increase in the register usage to store temporary variables.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;You can try out timing the above piece of code to find out the difference using the technique specified in my earlier article&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4928033" width="1" height="1"&gt;</description></item><item><title>Timing Managed code in .NET</title><link>http://blogs.msdn.com/amolravande/archive/2007/09/15/timing-managed-code-in-net.aspx</link><pubDate>Sat, 15 Sep 2007 16:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4928003</guid><dc:creator>amolravande</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/amolravande/comments/4928003.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amolravande/commentrss.aspx?PostID=4928003</wfw:commentRss><description>&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;Lets start off with a simple, yet quite useful article on &lt;SPAN style="FONT-WEIGHT: bold"&gt;Timing Managed code&lt;/SPAN&gt;. I will be using this in my future articles to test performance of certain pieces of code. A lot of sites mention the use of WIN32 functions &lt;SPAN style="FONT-WEIGHT: bold"&gt;QueryPerformanceCounter&lt;/SPAN&gt; and &lt;FONT style="FONT-FAMILY: Times New Roman,Times,Serif"&gt;&lt;SPAN style="FONT-WEIGHT: bold"&gt;QueryPerformanceFrequency&lt;/SPAN&gt;. They provide timing results with nano-second accuracy. Here's a good article if you guys wanna try out timing managed code using these functions.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT style="FONT-FAMILY: Times New Roman,Times,Serif" size=3&gt; &lt;SPAN style="COLOR: rgb(51,51,153)"&gt;http://&lt;A href="http://msdn2.microsoft.com/en-us/library/ms979201.aspx"&gt;&lt;FONT color=#0066a7&gt;msdn2.microsoft.com/en-us/library/ms979201.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;BR style="COLOR: rgb(51,51,153)"&gt;&lt;/FONT&gt;&lt;FONT style="FONT-FAMILY: Times New Roman,Times,Serif"&gt;&lt;BR&gt;&lt;FONT size=3&gt;However, using these functions is quite inconvenient. Starting with .NET 2.0 comes the &lt;SPAN style="FONT-WEIGHT: bold"&gt;StopWatch&lt;/SPAN&gt; class(also included in .NET 3.0). &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT style="FONT-FAMILY: Times New Roman,Times,Serif"&gt;&lt;FONT size=3&gt;Since all Windows systems that support .NET also include a high-resolution performance counter, you can pretty much count on the Stopwatch being a high-resolution timer. If you’re unsure, check the static Stopwatch.IsHighResolution property, which will tell you whether the timer is based on a high-resolution performance counter.&lt;BR&gt;Check out &lt;SPAN style="COLOR: rgb(0,0,128)"&gt;http://msdn2.microsoft.com/en-us/library/system.diagnostics.stopwatch(vs.80).aspx&lt;/SPAN&gt; for information on StopWatch class. The only problem with StopWatch class is that you need to reset the timer everytime you use start and stop methods.Thats because StopWatch accumulates timing values.&lt;BR&gt;&lt;BR&gt;Here is the code&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; long Frequency, Ticks, TotalTime;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stopwatch sw = new Stopwatch();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Frequency = Stopwatch.Frequency;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Start();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // your code goes here&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Stop();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ticks = sw.ElapsedTicks;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalTime=1000000L*Ticks/Frequency;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Total time in microseconds "+TotalTime);&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Here, Frequency is returned as ticks/sec. So if you want time in nano-seconds use 10^9 instead of 10^6 in the TotalTime formula.&lt;BR&gt;&lt;/FONT&gt;&lt;A&gt;&lt;/A&gt;&lt;SPAN style="TEXT-DECORATION: underline"&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;Also StopWatch frequency depends on the installed hardware and operating system, hence the &lt;B&gt;Frequency&lt;/B&gt; value remains constant while the system is running.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4928003" width="1" height="1"&gt;</description></item></channel></rss>