<?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>Large Object Heap Improvements in .NET 4.5</title><link>http://blogs.msdn.com/b/dotnet/archive/2011/10/04/large-object-heap-improvements-in-net-4-5.aspx</link><description>Garbage collection is one of premiere features of the .NET managed coding platform. As the platform has become more capable, we&amp;rsquo;re seeing developers allocate more and more large objects. Since large objects are managed differently than small objects</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Large Object Heap Improvements in .NET 4.5</title><link>http://blogs.msdn.com/b/dotnet/archive/2011/10/04/large-object-heap-improvements-in-net-4-5.aspx#10420369</link><pubDate>Tue, 21 May 2013 17:52:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10420369</guid><dc:creator>Alina Popa</dc:creator><description>&lt;p&gt;@Mickey,&lt;/p&gt;
&lt;p&gt;What .NET Framework version do you use? Do you still have the high fragmentation problem when running on .NET 4.5?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10420369" width="1" height="1"&gt;</description></item><item><title>re: Large Object Heap Improvements in .NET 4.5</title><link>http://blogs.msdn.com/b/dotnet/archive/2011/10/04/large-object-heap-improvements-in-net-4-5.aspx#10420037</link><pubDate>Mon, 20 May 2013 12:15:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10420037</guid><dc:creator>Mickey Puri</dc:creator><description>&lt;p&gt;Its quite remarkable that something mature such as the .Net platform has such a fundamental issue. What are the guys at MS doing? I mean its all very well to race ahead, but if you&amp;#39;ve got a weakness in the foundations then surely before you add extra levels sort out the foundations. &lt;/p&gt;
&lt;p&gt;I&amp;#39;ve started work at a company here where they regularly have to recycle their app pools, and I&amp;#39;ve tracked this down to large amounts of memory being allocated due to fragmentation. Specifically: 165MB allocated of which 90MB were free but due to fragmentation 20MB was the biggest memory fragment available.&lt;/p&gt;
&lt;p&gt;still searching for a workaround as not convinced that the object pooling will work here.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10420037" width="1" height="1"&gt;</description></item><item><title>re: Large Object Heap Improvements in .NET 4.5</title><link>http://blogs.msdn.com/b/dotnet/archive/2011/10/04/large-object-heap-improvements-in-net-4-5.aspx#10383258</link><pubDate>Tue, 08 Jan 2013 19:38:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10383258</guid><dc:creator>Ray</dc:creator><description>&lt;p&gt;How about just give us a function called &amp;quot;CompactLargeObjectHeapNow()&amp;quot; for the cases where the developer decides that the tradeoff of spending time to compact the LOH is preferable to OutOfMemoryException?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10383258" width="1" height="1"&gt;</description></item><item><title>re: Large Object Heap Improvements in .NET 4.5</title><link>http://blogs.msdn.com/b/dotnet/archive/2011/10/04/large-object-heap-improvements-in-net-4-5.aspx#10365921</link><pubDate>Mon, 05 Nov 2012 21:08:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10365921</guid><dc:creator>Brandon Bray</dc:creator><description>&lt;p&gt;@Sam, @Rama&lt;/p&gt;
&lt;p&gt;You both bring up good issues that I and the garbage collection team would love to learn more about. Given the frustration to your development teams, we do want to understand the situation. It will help us understand the space better as we prioritize and design improvements to the GC. Additionally, it may help us give you advice on further improvements.&lt;/p&gt;
&lt;p&gt;Can you reach out to us via the &amp;quot;contact&amp;quot; form located at the top right of the blog? We can then follow up to schedule a phone conversation.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10365921" width="1" height="1"&gt;</description></item><item><title>re: Large Object Heap Improvements in .NET 4.5</title><link>http://blogs.msdn.com/b/dotnet/archive/2011/10/04/large-object-heap-improvements-in-net-4-5.aspx#10365117</link><pubDate>Fri, 02 Nov 2012 06:33:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10365117</guid><dc:creator>deherb3185</dc:creator><description>&lt;p&gt;@dmitri The memory allocator may not have been able to use them because they were too small to satisfy the allocation requests&lt;/p&gt;
&lt;p&gt;-Deon - MSFT&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10365117" width="1" height="1"&gt;</description></item><item><title>re: Large Object Heap Improvements in .NET 4.5</title><link>http://blogs.msdn.com/b/dotnet/archive/2011/10/04/large-object-heap-improvements-in-net-4-5.aspx#10364827</link><pubDate>Thu, 01 Nov 2012 10:51:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10364827</guid><dc:creator>dmitri</dc:creator><description>&lt;p&gt;What does &amp;quot;Now the memory allocator will revisit the memory fragments that earlier allocation couldn’t use.&amp;quot; mean ?&lt;/p&gt;
&lt;p&gt;What are situations where memory allocator couldn&amp;#39;t use some fragments ?&lt;/p&gt;
&lt;p&gt;P.S. I would also vote for compacting LOH, it is just really annoying to have to manage memory ourselves, isn&amp;#39;t it the whole point of managed language ?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10364827" width="1" height="1"&gt;</description></item><item><title>re: Large Object Heap Improvements in .NET 4.5</title><link>http://blogs.msdn.com/b/dotnet/archive/2011/10/04/large-object-heap-improvements-in-net-4-5.aspx#10364277</link><pubDate>Tue, 30 Oct 2012 23:17:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10364277</guid><dc:creator>Rama</dc:creator><description>&lt;p&gt;To deal with LOH fragmentation issues these are some of the following workarounds we put in place:&lt;/p&gt;
&lt;p&gt;Moved to using /3Gb switch. This has its own nightmares as it reduces the kernel memory space.&lt;/p&gt;
&lt;p&gt;Implemented our on memory manager. Allocates large blocks of double and float arrays (which are the max of what we would ever use in the system). This scheme kills your ability to do any parallel work on the blocks due to the possibility of stomping. Hard to put in place constructs to improve performance using multiple cores.&lt;/p&gt;
&lt;p&gt;Every release cycle we spend 2 to 3 months spinning on memory reducing efforts so we can support all of our customer requested features.&lt;/p&gt;
&lt;p&gt;We are moving to 64bit env just shifting the problem and issue of LOH to a larger memory env.&lt;/p&gt;
&lt;p&gt;Object pooling DOES NOT WORK for us as the content that enters the LOH are double and float arrays not our c# objects. Secondly, the arrays are rapidly allocated and released in less than few seconds. These arrays are NEVER same size, these are VARYING in size and there is NO predictable pattern of allocations to come up with array caching strategies.&lt;/p&gt;
&lt;p&gt;Indirectly customers are suffering because of the LOH issues. Customers who PAY for applications DO NOT WISH to see OOM exceptions and crashes due to OOM.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10364277" width="1" height="1"&gt;</description></item><item><title>re: Large Object Heap Improvements in .NET 4.5</title><link>http://blogs.msdn.com/b/dotnet/archive/2011/10/04/large-object-heap-improvements-in-net-4-5.aspx#10361582</link><pubDate>Mon, 22 Oct 2012 04:43:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10361582</guid><dc:creator>Sam</dc:creator><description>&lt;p&gt;@Brandon Bray&lt;/p&gt;
&lt;p&gt;Opening 4 modules of our product operates at around 1.2GB for a particular client. If the client refreshes the modules multiple times, the total memory level stays consistent however out of memory exceptions occur and the application must be terminated and restarted. This is confirmed to have not changed in dot net 4.5 and is a great frustration for our customers.&lt;/p&gt;
&lt;p&gt;It is very hard to say to a customer &amp;quot;Yes we can spend 40 hours to improve the usage memory by 200MB but if you use the application all day it probably will crash anyway&amp;quot; and have a positive reaction.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry if this is coming off as negative and frustrated but this is the reality of our situation. I cannot see why the large object heap is never defragmented under any circumstances. It just does not make sense to me. The performance hit of even a manually triggered event will never ever be anywhere near as impactful as the damage to our reputation that this platform has caused and is causing.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10361582" width="1" height="1"&gt;</description></item><item><title>re: Large Object Heap Improvements in .NET 4.5</title><link>http://blogs.msdn.com/b/dotnet/archive/2011/10/04/large-object-heap-improvements-in-net-4-5.aspx#10361036</link><pubDate>Fri, 19 Oct 2012 05:07:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10361036</guid><dc:creator>Sam</dc:creator><description>&lt;p&gt;@Brandon Bray&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll complete some concrete analysis and post back.&lt;/p&gt;
&lt;p&gt;Sam&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10361036" width="1" height="1"&gt;</description></item><item><title>re: Large Object Heap Improvements in .NET 4.5</title><link>http://blogs.msdn.com/b/dotnet/archive/2011/10/04/large-object-heap-improvements-in-net-4-5.aspx#10359664</link><pubDate>Mon, 15 Oct 2012 13:17:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10359664</guid><dc:creator>Brandon Bray</dc:creator><description>&lt;p&gt;@Mani, as this article and the recent article on GC indicates, we have invested a lot in the .NET garbage collector. We have even made improvements to the LOH. I encourage you to try .NET 4.5 to see if you notice these improvements. If you are actually facing the same problems with .NET 4.5, feel free to contact us at dotnet@microsoft.com. We would love to work with you.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10359664" width="1" height="1"&gt;</description></item></channel></rss>