<?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>Memory management in the .NET Framework</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx</link><description>This is a subject that has been covered before and I have no intention of writing the ultimate post on the subject. Still I think this is something that every good developer should know. Why do I need to know this? My colleagues and I are quite often</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Garbage Collection in the .NET Framework &amp;laquo; Tim.GetInstance( )</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#2208320</link><pubDate>Fri, 20 Apr 2007 18:22:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2208320</guid><dc:creator>Garbage Collection in the .NET Framework « Tim.GetInstance( )</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://bigtunatim.wordpress.com/2007/04/20/garbage-collection-in-the-net-framework/"&gt;http://bigtunatim.wordpress.com/2007/04/20/garbage-collection-in-the-net-framework/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Memory management in the .NET Framework</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#2242650</link><pubDate>Mon, 23 Apr 2007 10:30:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2242650</guid><dc:creator>JohanS</dc:creator><description>&lt;p&gt;I updated the post. I re-read it and thought that the &amp;quot;What happens during GC?&amp;quot; section could be a bit more elaborate.&lt;/p&gt;
&lt;p&gt;Mea culpa / Johan&lt;/p&gt;
</description></item><item><title>re: Memory management in the .NET Framework</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#2314226</link><pubDate>Sat, 28 Apr 2007 21:32:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2314226</guid><dc:creator>Pini Usha</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You state to avoid 85k or bigger objects, but &lt;/p&gt;
&lt;p&gt;how can I measure the size of my object?&lt;/p&gt;
</description></item><item><title>re: Memory management in the .NET Framework</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#2373857</link><pubDate>Wed, 02 May 2007 16:21:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2373857</guid><dc:creator>JohanS</dc:creator><description>&lt;p&gt;The immediate answer to this question is to do what I describe in &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/johan/archive/2007/01/11/i-am-getting-outofmemoryexceptions-how-can-i-troubleshoot-this.aspx"&gt;http://blogs.msdn.com/johan/archive/2007/01/11/i-am-getting-outofmemoryexceptions-how-can-i-troubleshoot-this.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This might be a bit more low-level approach than you expected, but it really is a good way to look at what you're populating the stack with.&lt;/p&gt;
&lt;p&gt;However; as I tried to describe in my post you only need to pay attention to the individual elements. If your object conatins nine 10 KB strings, then the strings are stored as individual elements and the object itself only contains references to the strings. So nothing would end up on the large object heap.&lt;/p&gt;
&lt;p&gt;If you had an object with one 90 KB string, though, the string would be on the large object heap, but the object itself would not.&lt;/p&gt;
&lt;p&gt;/ Johan&lt;/p&gt;
</description></item><item><title>re: Memory management in the .NET Framework</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#3063680</link><pubDate>Sun, 03 Jun 2007 18:04:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3063680</guid><dc:creator>Jeremy Wiebe</dc:creator><description>&lt;p&gt;In your last point you say &amp;quot;Don't use finalizers&amp;quot;... Am I correct in assuming that doesn't include classes that are written using the IDisposable pattern where the code uses deterministic finalization?&lt;/p&gt;
</description></item><item><title>re: Memory management in the .NET Framework</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#3072847</link><pubDate>Mon, 04 Jun 2007 08:22:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3072847</guid><dc:creator>JohanS</dc:creator><description>&lt;p&gt;Hi Jeremy,&lt;/p&gt;
&lt;p&gt;You're absolutely correct in your assumption.&lt;/p&gt;
&lt;p&gt;Deterministic finalization is a whole other ballgame. The reason why you wouldn't use (and more importantly; rely 100% on) finalizers is because they will get invoked by the GC, and thereby be promoted to the next generation. That doesn't apply if you use the IDisposeable pattern correctly.&lt;/p&gt;
&lt;p&gt;There is a potential risk in the fact that people tend to ignore calling .Dispose, but if implemented and executed correctly it is great.&lt;/p&gt;
</description></item><item><title>.NET Tips &amp; Tricks </title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#3273036</link><pubDate>Wed, 13 Jun 2007 22:17:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3273036</guid><dc:creator>Michael's Coding Den</dc:creator><description>&lt;p&gt;Last update: June 13 , 2007 Document version 0.6 Preface If you have something to add, or want to take&lt;/p&gt;
</description></item><item><title>Top 20 .NET Garbage Collection (GC) Articles</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#3502046</link><pubDate>Sun, 24 Jun 2007 20:29:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3502046</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>Lot's of objects on the Large Object Heap on a 64-bit server</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#8339227</link><pubDate>Thu, 27 Mar 2008 11:17:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8339227</guid><dc:creator>Speaking of which...</dc:creator><description>&lt;p&gt;My colleague Tess showed me a dump today which I thought was really interesting. The scenario was as&lt;/p&gt;
</description></item><item><title>The KB article every one should know about</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#8339234</link><pubDate>Thu, 27 Mar 2008 11:18:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8339234</guid><dc:creator>Speaking of which...</dc:creator><description>&lt;p&gt;Have you read &lt;a rel="nofollow" target="_new" href="http://support.microsoft.com/?kbid=307340"&gt;http://support.microsoft.com/?kbid=307340&lt;/a&gt; ? If not, I suggest you do so. If you need convincing&lt;/p&gt;
</description></item><item><title>Finalizers and weak references</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#8339236</link><pubDate>Thu, 27 Mar 2008 11:18:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8339236</guid><dc:creator>Speaking of which...</dc:creator><description>&lt;p&gt;What do finalizers and weak references have in common? Well more than you might think actually. Finalizers&lt;/p&gt;
</description></item><item><title>.NET Memory Management – Resources</title><link>http://blogs.msdn.com/johan/archive/2007/04/20/memory-management-in-the-net-framework.aspx#9304890</link><pubDate>Sun, 11 Jan 2009 02:41:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9304890</guid><dc:creator>Scott Dorman's Blog</dc:creator><description>&lt;p&gt;Note : This entry was originally posted on 9/14/2008 5:16:11 PM. I present at a lot of the local Florida&lt;/p&gt;
</description></item></channel></rss>