<?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>Mid-life crisis</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx</link><description>This particular problem (I call it mid-life-crisis) seems to come up fairly often so I thought I'd write up some general advice on it. The symptoms go something like this: There is a server process (usually a web server) and that process has a high percentage</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Avoiding Expensive Garbage Collections in Asynchrony</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#41285</link><pubDate>Thu, 04 Dec 2003 23:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:41285</guid><dc:creator>Ken Brubaker</dc:creator><description /></item><item><title>re: Mid-life crisis</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#41471</link><pubDate>Fri, 05 Dec 2003 18:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:41471</guid><dc:creator>Ian Griffiths</dc:creator><description>I'm surprised to learn that setting variables to null helps so much.  My experiments seem to suggest that the garbage collector is doing liveness analysis (or is taking advantage of the liveness analysis performed by the JIT).  So with something like this:&lt;br&gt;&lt;br&gt;&lt;br&gt;  MyObj o = new MyObj();&lt;br&gt;  o.DoSomethingWithO();&lt;br&gt;  BlockForAges();&lt;br&gt;  return;&lt;br&gt;&lt;br&gt;the GC usually seems to work out that 'o' isn't used after that second line, and will happily collect the object (or at least it'll run its Finalize if I put a finalizer in there as an experiment to see what the GC is doing) if a GC occurrs during BlockForAges.  Setting o to null doesn't seem to make any difference, since the liveness analysis has already worked out that o is effectively out of scope.&lt;br&gt;&lt;br&gt;Are there situations in which this liveness analysis is defeated?  Or is this not the scenario you're thinking of when you say to set things to null?</description></item><item><title>re: Mid-life crisis</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#41480</link><pubDate>Fri, 05 Dec 2003 18:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:41480</guid><dc:creator>Rico Mariani</dc:creator><description>You're absolutely right, if the JIT can statically determine that the variable is dead when the code is generated then there's no need null things out.  However, what often happens in servers is that there are certain transaction state variables that are, for instance, on the &amp;quot;this&amp;quot; pointer which are still reachable.  Those are the ones to null if you can.  &lt;br&gt;&lt;br&gt;For instance, suppose you got your input in XML format and you had a series of functions to extract what you need to do the query out of the XML, building up a SQL query string as you go.  Just before you make the SQL query, it would be good to release all the stuff related to the XML that you can so that it can be collected.  Objects like that are often fields accessable via your &amp;quot;this&amp;quot; pointer rather than local variables, so they are reachable until the object holding them goes away.&lt;br&gt;&lt;br&gt;Other times there are helper collection classes that assist in the parsing and validation of the inputs.  These objects also need to survive across several function calls (they are often accumulating results as process goes along), again these would seem live to the collector but perhaps they can be nulled or emptied.&lt;br&gt;</description></item><item><title>re: Mid-life crisis</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#41483</link><pubDate>Fri, 05 Dec 2003 19:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:41483</guid><dc:creator>Rico Mariani</dc:creator><description>Let me alter your example just a tad, this is a stupid example using intermediate strings just to illustrate&lt;br&gt;&lt;br&gt;class MyObj&lt;br&gt;{&lt;br&gt;   private String s1;&lt;br&gt;   private String s2;&lt;br&gt;   private String s3;&lt;br&gt;&lt;br&gt;   public void DoSomethingFromInputs(String s)&lt;br&gt;   {&lt;br&gt;       ...&lt;br&gt;       s1 = AnElegantOperation(s);&lt;br&gt;       ...&lt;br&gt;   }&lt;br&gt;&lt;br&gt;   public void ComputeInterimResults(String options)&lt;br&gt;   {&lt;br&gt;       ...&lt;br&gt;       s2 = SomethingEvenMoreElegant(s1, options);&lt;br&gt;       ...&lt;br&gt;   }&lt;br&gt;&lt;br&gt;   public void ComputerFinalQuery(String database)&lt;br&gt;   {&lt;br&gt;       ...&lt;br&gt;       s3 = SQLFormatting(s2, database);&lt;br&gt;       ...&lt;br&gt;   }&lt;br&gt;&lt;br&gt;   public String GetResults()&lt;br&gt;   {&lt;br&gt;       ...&lt;br&gt;       s1 = null;  // this is what I'm talking about&lt;br&gt;       s2 = null;  // this is what I'm talking about&lt;br&gt;       // this blocks a long time&lt;br&gt;       String r = GetDataFromDatabase(s3)&lt;br&gt;       ...&lt;br&gt;       return r;&lt;br&gt;   }&lt;br&gt;}&lt;br&gt;&lt;br&gt;MyObj o = new MyObj(); &lt;br&gt;o.DoSomethingFromInputs(s);&lt;br&gt;o.ComputeInterimResults(options);&lt;br&gt;o.ComputeFinalQuery(databasename);&lt;br&gt;return o.GetResults(); &lt;br&gt;&lt;br&gt;(please forgive my syntax, I hope you can get the jist)</description></item><item><title>re: Mid-life crisis</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#41609</link><pubDate>Sat, 06 Dec 2003 04:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:41609</guid><dc:creator>Jerry Dennany</dc:creator><description>Rico, thanks for clearing that up - I also shared Ken's concerns when reading your original post.  </description></item><item><title>GC Performance</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#71289</link><pubDate>Wed, 11 Feb 2004 17:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:71289</guid><dc:creator>Code and Stuff</dc:creator><description /></item><item><title>GC Performance</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#71291</link><pubDate>Wed, 11 Feb 2004 17:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:71291</guid><dc:creator>Code and Stuff</dc:creator><description /></item><item><title>GC Performance</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#79510</link><pubDate>Wed, 25 Feb 2004 03:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:79510</guid><dc:creator>Code 'n' Stuff</dc:creator><description /></item><item><title>re: XmlSerializer and Stale UI's</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#81433</link><pubDate>Sat, 28 Feb 2004 10:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:81433</guid><dc:creator>Code 'n' Stuff</dc:creator><description /></item><item><title>GC Performance</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#87786</link><pubDate>Thu, 11 Mar 2004 11:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:87786</guid><dc:creator>Extreme RAD from a Trading Desk</dc:creator><description /></item><item><title>A Few Good GC Links</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#229481</link><pubDate>Tue, 14 Sep 2004 20:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:229481</guid><dc:creator>Chris Lyon's WebLog</dc:creator><description /></item><item><title>A Few Good GC Links</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#229552</link><pubDate>Tue, 14 Sep 2004 21:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:229552</guid><dc:creator>Chris Lyon's WebLog</dc:creator><description /></item><item><title>When to call GC.Collect()</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#271834</link><pubDate>Mon, 29 Nov 2004 23:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:271834</guid><dc:creator>Rico Mariani's Performance Tidbits</dc:creator><description /></item><item><title>re: When to call GC.Collect()</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#272388</link><pubDate>Tue, 30 Nov 2004 21:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:272388</guid><dc:creator>Rico Mariani's Performance Tidbits</dc:creator><description /></item><item><title>Top Ten reasons you should subscribe to my blog</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#282214</link><pubDate>Mon, 13 Dec 2004 23:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:282214</guid><dc:creator>Rico Mariani's Performance Tidbits</dc:creator><description /></item><item><title>.net Garbage Collector Tips and Tricks</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#323172</link><pubDate>Fri, 17 Dec 2004 06:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:323172</guid><dc:creator>Tony's Blog</dc:creator><description /></item><item><title>.net Garbage Collector Tips and Tricks</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#333067</link><pubDate>Tue, 28 Dec 2004 05:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:333067</guid><dc:creator>Tony's Blog</dc:creator><description /></item><item><title>Performance Quiz #5: The performance cost of the garbage collector : Solution</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#348720</link><pubDate>Fri, 07 Jan 2005 22:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:348720</guid><dc:creator>Rico Mariani's Performance Tidbits</dc:creator><description /></item><item><title>.NET and </title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#364410</link><pubDate>Tue, 01 Feb 2005 11:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:364410</guid><dc:creator>Mike Taulty's Weblog</dc:creator><description /></item><item><title>re: Common Sources of Processor Performance Penalties: Five Issues</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#384358</link><pubDate>Thu, 03 Mar 2005 20:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:384358</guid><dc:creator>Rico Mariani's Performance Tidbits</dc:creator><description /></item><item><title>The Tale of two garbage collectors.</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#392161</link><pubDate>Thu, 10 Mar 2005 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:392161</guid><dc:creator>Josh Carlisle - .Net Brain Freeze</dc:creator><description /></item><item><title>The Tale of Citrix Development and Two Garbage Collectors.</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#392221</link><pubDate>Thu, 10 Mar 2005 19:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:392221</guid><dc:creator>Josh Carlisle - .Net Brain Freeze</dc:creator><description /></item><item><title>The Tale of Citrix Development and Two Garbage Collectors.</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#392225</link><pubDate>Thu, 10 Mar 2005 19:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:392225</guid><dc:creator>Josh Carlisle - .Net Brain Freeze</dc:creator><description /></item><item><title>Three techniques for tracking down leaks due to undisposed objects</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#408652</link><pubDate>Fri, 15 Apr 2005 20:51:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:408652</guid><dc:creator>Rico Mariani's Performance Tidbits</dc:creator><description>People often ask me for tips/tricks on how to find out which objects are not being properly disposed.&amp;amp;amp;nbsp;&amp;amp;amp;nbsp;But...</description></item><item><title>Tame the CLR: Expect game-quality real-time performance from managed code</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#717926</link><pubDate>Thu, 24 Aug 2006 19:26:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:717926</guid><dc:creator>Robert Burke's Weblog</dc:creator><description>Game development is one of those dark arts where the usual laws of scalability don't always apply.&amp;amp;amp;nbsp;...</description></item><item><title>
		  On CLR Memory Management:  Problem Solved&amp;#8230;? &amp;laquo; The Compulsive Coder	</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#1285762</link><pubDate>Thu, 14 Dec 2006 18:23:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1285762</guid><dc:creator>
		  On CLR Memory Management:  Problem Solved…? « The Compulsive Coder	</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://compulsivecoder.com/caffeine/?p=15"&gt;http://compulsivecoder.com/caffeine/?p=15&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>  .NET Garbage Collector PopQuiz - Followup at  Sanal Kiler</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#2146786</link><pubDate>Sun, 15 Apr 2007 23:07:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2146786</guid><dc:creator>  .NET Garbage Collector PopQuiz - Followup at  Sanal Kiler</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://sanal.org/?p=309"&gt;http://sanal.org/?p=309&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>.NET Garbage Collector PopQuiz - Followup</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#2162049</link><pubDate>Tue, 17 Apr 2007 12:14:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2162049</guid><dc:creator>If broken it is, fix it you should</dc:creator><description>&lt;p&gt;It was really exciting to see that so many people answered the .NET GC PopQuiz , especially seeing that&lt;/p&gt;
</description></item><item><title>Top 20 .NET Garbage Collection (GC) Articles</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#3452773</link><pubDate>Fri, 22 Jun 2007 07:41:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3452773</guid><dc:creator>roy ashbrook</dc:creator><description>&lt;p&gt;Ah. Garbage Collection... how I love and hate thee. =P I think one sad thing about programming in .net&lt;/p&gt;</description></item><item><title>Top 20 .NET Garbage Collection (GC) Articles</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#3452800</link><pubDate>Fri, 22 Jun 2007 07:43:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3452800</guid><dc:creator>roy ashbrook</dc:creator><description>&lt;p&gt;Ah. Garbage Collection... how I love and hate thee. =P I think one sad thing about programming in .net&lt;/p&gt;</description></item><item><title>Top 20 .NET Garbage Collection (GC) Articles</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#3453194</link><pubDate>Fri, 22 Jun 2007 08:36:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3453194</guid><dc:creator>roy ashbrook</dc:creator><description>&lt;p&gt;Ah. Garbage Collection... how I love and hate thee. =P I think one sad thing about programming in .net&lt;/p&gt;</description></item><item><title>.Net Performance pointers</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#8202255</link><pubDate>Fri, 14 Mar 2008 15:33:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8202255</guid><dc:creator>Dotmad (on .Net)</dc:creator><description>&lt;p&gt;After going this week to the Microsoft performance open house , here are few things to consider: Create&lt;/p&gt;
</description></item><item><title>The CLR garbage collector is in need of help</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#8593011</link><pubDate>Thu, 12 Jun 2008 14:48:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8593011</guid><dc:creator>C# Nuggets</dc:creator><description>&lt;p&gt;Back in 2000 when the CLR was first shown it&amp;amp;#39;s generational garbage collector was fairly cutting&lt;/p&gt;
</description></item><item><title>   [??????]??????Top 20 .NET Garbage Collection (GC) ??????  : ????????????????????? TAHETA.ORG</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#9249904</link><pubDate>Tue, 23 Dec 2008 15:35:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9249904</guid><dc:creator>   [??????]??????Top 20 .NET Garbage Collection (GC) ??????  : ????????????????????? TAHETA.ORG</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.taheta.org/?p=94"&gt;http://www.taheta.org/?p=94&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>James Kovacs' Weblog - Debug Leaky Apps: Identify and Prevent Memory Leaks in Managed Code</title><link>http://blogs.msdn.com/ricom/archive/2003/12/04/41281.aspx#9252905</link><pubDate>Fri, 26 Dec 2008 09:09:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9252905</guid><dc:creator>James Kovacs' Weblog - Debug Leaky Apps: Identify and Prevent Memory Leaks in Managed Code</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.jameskovacs.com/blog/DebugLeakyAppsIdentifyAndPreventMemoryLeaksInManagedCode.aspx"&gt;http://www.jameskovacs.com/blog/DebugLeakyAppsIdentifyAndPreventMemoryLeaksInManagedCode.aspx&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>