<?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>Unmanaged Memory Fragmentation -- an old story</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx</link><description>Before I worked on the CLR I spent several years in MSN. One of the big projects I worked on was "Sidewalk" which among other things offered a yellow pages service. A lot of this work was done under IIS with ISAPI extensions and you can imagine the fun</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>SteveX Compiled  &amp;raquo; Blog Archive   &amp;raquo; Heap Fragmentation</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#523756</link><pubDate>Fri, 03 Feb 2006 06:02:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:523756</guid><dc:creator>SteveX Compiled  » Blog Archive   » Heap Fragmentation</dc:creator><description>PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.stevex.net/index.php/2006/02/02/heap-fragmentation/"&gt;http://blog.stevex.net/index.php/2006/02/02/heap-fragmentation/&lt;/a&gt;</description></item><item><title>re: Unmanaged Memory Fragmentation -- an old story</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#523773</link><pubDate>Fri, 03 Feb 2006 06:33:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:523773</guid><dc:creator>Norman Diamond</dc:creator><description>&amp;gt; It took me over a week to diagnose just this&lt;br/&gt;&amp;gt; one bug, although it took me only about 10&lt;br/&gt;&amp;gt; minutes to fix it once I knew what was going&lt;br/&gt;&amp;gt; on.  Aren't you glad you don't have to deal&lt;br/&gt;&amp;gt; with that sort of mess?&lt;br/&gt;&lt;br/&gt;Um, I thought everyone had to deal with that kind of mess, not usually but often enough that it would happen to everyone.&lt;br/&gt;&lt;br/&gt;On the other hand, the solutions that you describe here sound like more than 10 minutes of work.&lt;br/&gt;</description></item><item><title>re: Unmanaged Memory Fragmentation -- an old story</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#523891</link><pubDate>Fri, 03 Feb 2006 11:31:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:523891</guid><dc:creator>Davy Landman</dc:creator><description>why would you think it would take that much more work? maybe figuring out, but with a good design, such a change would only have to be made in one place.. &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;I've never heard of this idea, but I must say, I like it! Did you get the idea by yourself? Or is it form a article/patern?</description></item><item><title>re: Unmanaged Memory Fragmentation -- an old story</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#523952</link><pubDate>Fri, 03 Feb 2006 13:45:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:523952</guid><dc:creator>Will Dean</dc:creator><description>&amp;quot;Aren't you glad you don't have to deal with that sort of mess?&amp;quot;&lt;br/&gt;&lt;br/&gt;But I too have to deal with this sort of mess all the time, and I generally have to do it without access to the source code, developers or secret knowledge about a vast propertion of the stuff I'm dealing with.  Incidentally, that's a fact which I would beat into Raymond Chen with a baseball bat if I ever had a quiet five minutes with him...&lt;br/&gt;&lt;br/&gt;But I must say, I do like the simple ping-ponging strategy for heap tidying.&lt;br/&gt;&lt;br/&gt;To the person who thought it would be hard, Rico's mod probably looked like a bit like this:&lt;br/&gt;&lt;br/&gt;if((++nAllocs % 100000) == 0) &lt;br/&gt;{ &lt;br/&gt;    heapIndexOffset ^= 0x10; &lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;Actually, Rico's so old, it probably looked like this:&lt;br/&gt;&lt;br/&gt;if((++nAllocs % 100000) == 0) { &lt;br/&gt;   heapIndexOffset ^= 0x10; &lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;;-)&lt;br/&gt;&lt;br/&gt;There.  There's only Larry Osterman to go and I shall have upset all the old folks...&lt;br/&gt;</description></item><item><title>re: Unmanaged Memory Fragmentation -- an old story</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#523957</link><pubDate>Fri, 03 Feb 2006 13:49:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:523957</guid><dc:creator>barrkel</dc:creator><description>&amp;quot;It took me over a week to diagnose just this one bug, although it took me only about 10 minutes to fix it once I knew what was going on.  Aren't you glad you don't have to deal with that sort of mess?&amp;quot;&lt;br/&gt;&lt;br/&gt;I think we all have these problems, Rico. Don't take this personally, because I don't mean this in any way disparagingly, it's just an observation: MS folks IMHO seem to think that what they do is more &amp;quot;heavyweight&amp;quot; than what anyone else does anywhere. In my opinion the biggest difference is the number of customers the rest of us have, not the depth or difficulty of the problems solved.</description></item><item><title>re: Unmanaged Memory Fragmentation -- an old story</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#524236</link><pubDate>Fri, 03 Feb 2006 21:01:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:524236</guid><dc:creator>ricom</dc:creator><description>&amp;gt;&amp;gt; Aren't you glad you don't have to deal with that sort of mess?&lt;br/&gt;&lt;br/&gt;&amp;gt;&amp;gt; In my opinion the biggest difference is the number of customers the rest of us have, not the depth or difficulty of the problems solved. &lt;br/&gt;&lt;br/&gt;Sorry about that, that was actually an attempt at humor (because it's old technology).  I was thinking most of my readers write managed code or else are using more modern operating systems that don't have that problem anymore.  I didn't mean to make any implication about the depth of my customers' problems...&lt;br/&gt;&lt;br/&gt;That was very clumsy of me.</description></item><item><title>re: Unmanaged Memory Fragmentation -- an old story</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#524284</link><pubDate>Fri, 03 Feb 2006 21:58:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:524284</guid><dc:creator>ricom</dc:creator><description>I changed the comment to be closer to what I intended.  &amp;quot;Aren't you glad our latest offerings do this better?&amp;quot;&lt;br/&gt;&lt;br/&gt;I apologize that my attempt at a self-slam could be taken the other way.  That was not intended.</description></item><item><title>re: Unmanaged Memory Fragmentation -- an old story</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#524334</link><pubDate>Fri, 03 Feb 2006 23:02:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:524334</guid><dc:creator>snaveen</dc:creator><description>What about managed heap fragmentation? Will you be able to write about this?</description></item><item><title>Interesting Finds</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#524584</link><pubDate>Sat, 04 Feb 2006 04:14:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:524584</guid><dc:creator>Jason Haley</dc:creator><description /></item><item><title>re: Unmanaged Memory Fragmentation -- an old story</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#525576</link><pubDate>Mon, 06 Feb 2006 14:25:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:525576</guid><dc:creator>barrkel</dc:creator><description>&amp;gt; What about managed heap fragmentation? Will you be able to write about this?&lt;br /&gt;&lt;br /&gt;The managed heap only gets fragmented when a pinned pointer refers to a block of memory in the middle of it and a garbage collection subsequently occurs. This fragmentation used to be pretty bad in .NET 1.0 and 1.1, but it's much better now. This one of the reasons that one should never pin an managed object for very long.&lt;br /&gt;&lt;br /&gt;Heap fragmentation is almost always not a problem because the .NET GC is a compacting collecter. In moving objects into appropriate generations, the free space in the gaps is eliminated. Having said that, to my knowledge it is possible, but unlikely, for the large object heap (objects &amp;gt; 86000 bytes) to suffer from minor fragmentation problems for certain odd patterns of allocation (but the allocations would have to keep on going, i.e. a lot of memory would still have to be explicitly allocated). There was a presentation on the GC heap at the PDC; the videos and presentations are available somewhere on microsoft.com.&lt;br /&gt;&lt;br /&gt;Rico has written on this:&lt;br /&gt;&lt;br /&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetgcbasics.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetgcbasics.asp&lt;/a&gt;&lt;br /&gt;</description></item><item><title>Dev Diligence: Don&amp;#8217;t Invest in the Wrong Code | Spiteful.com</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#8424713</link><pubDate>Fri, 25 Apr 2008 23:32:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8424713</guid><dc:creator>Dev Diligence: Don&amp;#8217;t Invest in the Wrong Code | Spiteful.com</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.spiteful.com/2008/04/25/dev-diligence-dont-invest-in-the-wrong-code/"&gt;http://www.spiteful.com/2008/04/25/dev-diligence-dont-invest-in-the-wrong-code/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Back To Basics: Mark and Sweep Garbage Collection</title><link>http://blogs.msdn.com/ricom/archive/2006/02/02/523626.aspx#9388684</link><pubDate>Sun, 01 Feb 2009 23:42:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9388684</guid><dc:creator>I know the answer (it's 42)</dc:creator><description>&lt;p&gt;This post is Part 4 in the series of posts on Garbage Collection (GC). Please see the index here. Recap&lt;/p&gt;
</description></item></channel></rss>