<?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>Who is this OutOfMemory guy and why does he make my process crash when I have plenty of memory left?</title><link>http://blogs.msdn.com/tess/archive/2005/11/25/who-is-this-outofmemory-guy-and-why-does-he-make-my-process-crash-when-i-have-plenty-of-memory-left.aspx</link><description>To answer this question, there are a few concepts we need to discuss. Working on a 32-bit system, you can address 4 GB of memory, out of this 2 GB is typically reserved to the Operating System and 2 GB are allowed for each user mode process, such as w3wp.exe</description><dc:language>sv-SE</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Who is this OutOfMemory guy and why does he make my process crash when I have plenty of memory left?</title><link>http://blogs.msdn.com/tess/archive/2005/11/25/who-is-this-outofmemory-guy-and-why-does-he-make-my-process-crash-when-i-have-plenty-of-memory-left.aspx#523617</link><pubDate>Fri, 03 Feb 2006 02:16:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:523617</guid><dc:creator>Mark Wan</dc:creator><description>This blog is right up the alley which we are challenged with on a day to day business.  Our server app gets out of memory exceptions when the process memory and the .net total heap is high.  I know at that situation what we need to do.  &lt;br/&gt;&lt;br/&gt;We have seen a new type of exception with the process memory is 400MB or so.  Do you have any insight as to why out of memory exceptions happen at such a low usage?&lt;br/&gt;&lt;br/&gt;thanks&lt;br/&gt;Mark</description></item><item><title>re: Who is this OutOfMemory guy and why does he make my process crash when I have plenty of memory left?</title><link>http://blogs.msdn.com/tess/archive/2005/11/25/who-is-this-outofmemory-guy-and-why-does-he-make-my-process-crash-when-i-have-plenty-of-memory-left.aspx#523858</link><pubDate>Fri, 03 Feb 2006 10:35:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:523858</guid><dc:creator>Tess</dc:creator><description>Hi Mark,&lt;br/&gt;&lt;br/&gt;I would recommend that you follow the steps in:&lt;br/&gt;&lt;a rel="nofollow" target="_new" href="http://support.microsoft.com/?id=820745"&gt;http://support.microsoft.com/?id=820745&lt;/a&gt;&lt;br/&gt;To set the GCFailFastOnOOM registry key to 2, and then gather a crash dump with adplus -crash. &lt;br/&gt;&lt;br/&gt;If you get OOM's at 400 MB, there are a few possibilities.&lt;br/&gt;&lt;br/&gt;1) your heap is severly fragmented&lt;br/&gt;2) you are allocating a huge object&lt;br/&gt;3) you get an OOM for some other reason than actually running out of virtual memory.  Some error codes in COM+ for example translate to OOM.&lt;br/&gt;&lt;br/&gt;Once you get a dump you can determine which one you are running in to like this. &lt;br/&gt;&lt;br/&gt;1) You can take a look at the stack making the allocation (and the eventlog) to find out how big of an allocation you are making.  (I have seen cases where for example the code allocates an array with the size based on a return value from some function, and that return value turned out to be completely bogus), if it's a very big allocation you run into case #1&lt;br/&gt;&lt;br/&gt;2) run !address, this will give you info about all reserved and used virtual segments, at the bottom of this list there is information about the largest contigous free space. If this is very low, say below 64 MB already at 400 MB private bytes, you have pretty bad fragmentation of the virtual memory space.  This can be caused by a number of things for example a)  a very large number of threads that are constantly killed and created (each thread takes up 0,5 - 1MB of stackspace depending on OS) and if they are constantly killed and created they will be spread out in hte vm space causing fragmentation  b) a COM object making many small virtual allocs  c) a large number of dlls, that are spread out a bit unevenly in the vm space.  etc.&lt;br/&gt;&lt;br/&gt;3) for the 3rd case, you would likely be able to identify this on the stack of the OOM when it happens. &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;I would also recommend that if this is an ASP.NET app, that you check that you dont have debug=true in any of your apps as this causes a certain amount of fragmentation which is of course bigger if there is a large number of dlls.&lt;br/&gt;Also check that your dlls are compiled in releasemode.&lt;br/&gt;&lt;br/&gt;You can do this in a dump as well by running !finddebugtrue and !finddebugmodules (from sos.dll) &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description></item><item><title>re: Who is this OutOfMemory guy and why does he make my process crash when I have plenty of memory left?</title><link>http://blogs.msdn.com/tess/archive/2005/11/25/who-is-this-outofmemory-guy-and-why-does-he-make-my-process-crash-when-i-have-plenty-of-memory-left.aspx#621461</link><pubDate>Thu, 08 Jun 2006 05:35:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:621461</guid><dc:creator>SG</dc:creator><description>Hi there,&lt;br&gt;i was curious about your point &amp;quot;Virtual allocations made by com components&amp;quot;. Can you provide some funtioncs that can be used for virtual memory allocations in COM? I am new to COM, hence not familiar with the usage stc.&lt;br&gt;&lt;br&gt;Thanks!</description></item><item><title>.NET Memory usage - A restaurant analogy</title><link>http://blogs.msdn.com/tess/archive/2005/11/25/who-is-this-outofmemory-guy-and-why-does-he-make-my-process-crash-when-i-have-plenty-of-memory-left.aspx#742569</link><pubDate>Wed, 06 Sep 2006 14:06:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:742569</guid><dc:creator>If broken it is, fix it you should</dc:creator><description>My favourite author Simon Singh is a wiz at analogies. In his book The big bang he explains concepts...</description></item><item><title>re: Who is this OutOfMemory guy and why does he make my process crash when I have plenty of memory left?</title><link>http://blogs.msdn.com/tess/archive/2005/11/25/who-is-this-outofmemory-guy-and-why-does-he-make-my-process-crash-when-i-have-plenty-of-memory-left.aspx#2814925</link><pubDate>Wed, 23 May 2007 15:12:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2814925</guid><dc:creator>vsbhhe</dc:creator><description>&lt;p&gt;Hello! You have an outstanding good and well structured site.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
</description></item><item><title>re: Who is this OutOfMemory guy and why does he make my process crash when I have plenty of memory left?</title><link>http://blogs.msdn.com/tess/archive/2005/11/25/who-is-this-outofmemory-guy-and-why-does-he-make-my-process-crash-when-i-have-plenty-of-memory-left.aspx#5956241</link><pubDate>Wed, 07 Nov 2007 13:36:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5956241</guid><dc:creator>none</dc:creator><description>&lt;p&gt;In .NET 2 there is no GCFailFastOnOOM, only:&lt;/p&gt;
&lt;p&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\GCBreakOnOOM&lt;/p&gt;
&lt;p&gt;1&lt;/p&gt;
</description></item><item><title>re: Who is this OutOfMemory guy and why does he make my process crash when I have plenty of memory left?</title><link>http://blogs.msdn.com/tess/archive/2005/11/25/who-is-this-outofmemory-guy-and-why-does-he-make-my-process-crash-when-i-have-plenty-of-memory-left.aspx#8618449</link><pubDate>Thu, 19 Jun 2008 00:28:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8618449</guid><dc:creator>dipbi</dc:creator><description>&lt;p&gt;Could you comment on garbage collection mechanisms on network performance monitoring agents and their effect on management of agent lifetime and application throughput ?&lt;/p&gt;
</description></item><item><title>Fragmentation mémoire sous IIS 6</title><link>http://blogs.msdn.com/tess/archive/2005/11/25/who-is-this-outofmemory-guy-and-why-does-he-make-my-process-crash-when-i-have-plenty-of-memory-left.aspx#9002714</link><pubDate>Fri, 17 Oct 2008 09:57:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9002714</guid><dc:creator>Blog de l'équipe support IIS France</dc:creator><description>&lt;p&gt;Bonjour, ce second article est consacr&amp;#233; &amp;#224; la fragmentation m&amp;#233;moire sous IIS6. Notez cependant qu'il peut&lt;/p&gt;
</description></item><item><title>re: Who is this OutOfMemory guy and why does he make my process crash when I have plenty of memory left?</title><link>http://blogs.msdn.com/tess/archive/2005/11/25/who-is-this-outofmemory-guy-and-why-does-he-make-my-process-crash-when-i-have-plenty-of-memory-left.aspx#9410726</link><pubDate>Tue, 10 Feb 2009 18:20:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9410726</guid><dc:creator>Senite</dc:creator><description>&lt;p&gt;Thanks. Very helpful article because things are clearly explained.&lt;/p&gt;
</description></item></channel></rss>