<?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>Some history on the ASP.NET cache memory limits</title><link>http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-cache-memory-limits.aspx</link><description>When v1.0 released, the only OS that ASP.NET supported was Win2k, the only process model was aspnet_wp, and the only architecture we supported was x86. The aspnet_wp process model had a memory limit that was calculated at runtime during startup. The limit</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Asp.Net Memory Limit - part 2 &amp;laquo; Jesper On Stuff</title><link>http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-cache-memory-limits.aspx#6722163</link><pubDate>Mon, 10 Dec 2007 14:19:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6722163</guid><dc:creator>Asp.Net Memory Limit - part 2 « Jesper On Stuff</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://jesperen.wordpress.com/2007/12/10/aspnet-memory-limit-part-2/"&gt;http://jesperen.wordpress.com/2007/12/10/aspnet-memory-limit-part-2/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Overlapped Recycling And SharePoint: Memory Based Recycling </title><link>http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-cache-memory-limits.aspx#6796753</link><pubDate>Tue, 18 Dec 2007 17:16:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6796753</guid><dc:creator>Steve Sheppards Blog</dc:creator><description>&lt;p&gt;I have already mentioned the values for Maximum Memory used and Maximum Virtual Memory we recommended&lt;/p&gt;
</description></item><item><title>Overlapped Recycling And SharePoint: Memory Based Recycling </title><link>http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-cache-memory-limits.aspx#6796893</link><pubDate>Tue, 18 Dec 2007 17:40:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6796893</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;I have already mentioned the values for Maximum Memory used and Maximum Virtual Memory we recommended&lt;/p&gt;
</description></item><item><title>Overlapped Recycling And SharePoint: A Hidden Benefit</title><link>http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-cache-memory-limits.aspx#6816947</link><pubDate>Thu, 20 Dec 2007 15:59:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6816947</guid><dc:creator>Steve Sheppards Blog</dc:creator><description>&lt;p&gt;There is a hidden value in configuring the overlapped recycling values. I was lucky enough to gain the&lt;/p&gt;
</description></item><item><title>Overlapped Recycling And SharePoint: A Hidden Benefit</title><link>http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-cache-memory-limits.aspx#6816967</link><pubDate>Thu, 20 Dec 2007 16:01:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6816967</guid><dc:creator>Steve Sheppards Blog</dc:creator><description>&lt;p&gt;There is a hidden value in configuring the overlapped recycling values. I was lucky enough to gain the&lt;/p&gt;
</description></item><item><title>Overlapped Recycling And SharePoint: A Hidden Benefit</title><link>http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-cache-memory-limits.aspx#6817263</link><pubDate>Thu, 20 Dec 2007 16:40:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6817263</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;There is a hidden value in configuring the overlapped recycling values. I was lucky enough to gain the&lt;/p&gt;
</description></item><item><title>re: Some history on the ASP.NET cache memory limits</title><link>http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-cache-memory-limits.aspx#9145101</link><pubDate>Wed, 26 Nov 2008 21:45:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9145101</guid><dc:creator>PaulJones</dc:creator><description>&lt;p&gt;ASP.NET Cache has many limitations associated with it. It is in-process and standalone, which means scalability will always be an issue. These days distributed caching is the talk of the town and for good reason. It provides the scalability, availability and performance that a high end application needs to perform at its peek. I recommend everybody look into this amazing phenomenon. Even MS has jumped into this arena with a product of their own. The future of high performance computing is distributed caching.&lt;/p&gt;
&lt;p&gt;All the best!&lt;/p&gt;
</description></item><item><title>re: Some history on the ASP.NET cache memory limits</title><link>http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-cache-memory-limits.aspx#9935220</link><pubDate>Thu, 10 Dec 2009 17:19:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9935220</guid><dc:creator>richardfremmerlid</dc:creator><description>&lt;p&gt;I've been examining this issue quite a bit over the past few days. &amp;nbsp;We have a variety of 32bit servers here ranging from 1GB of memory to 4GB of memory. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Code that works fine on our 1GB servers with Windows2003 would fail on machines with 3GB or 4GB with outofmemoryexceptions.&lt;/p&gt;
&lt;p&gt;Based on what you've mentioned in this article. &amp;nbsp;I have tried modifying the application pool memory recycling options within IIS and I've also tried to modify the &amp;lt;cache&amp;gt; settings within web.config.&lt;/p&gt;
&lt;p&gt;Here is a summary of my findings:&lt;/p&gt;
&lt;p&gt;1.	You can specify the physical memory limit for processes in 2 places&lt;/p&gt;
&lt;p&gt;a.	IIS application pool memory recycling (IIS Metabase)&lt;/p&gt;
&lt;p&gt;b.	Web.config &lt;/p&gt;
&lt;p&gt;&amp;lt;caching&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;cache &lt;/p&gt;
&lt;p&gt;				disableMemoryCollection = &amp;quot;false&amp;quot;&lt;/p&gt;
&lt;p&gt;				disableExpiration = &amp;quot;false&amp;quot;&lt;/p&gt;
&lt;p&gt;				privateBytesLimit = &amp;quot;629145600&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;percentagePhysicalMemoryUsedLimit = &amp;quot;20&amp;quot;&lt;/p&gt;
&lt;p&gt;				privateBytesPollTime = &amp;quot;00:02:00&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;		&amp;lt;/caching&amp;gt;&lt;/p&gt;
&lt;p&gt;2.	If you set neither of these values default calculations will take place based on your hardware configuration	&lt;/p&gt;
&lt;p&gt;a.	For 32bit machines with &amp;lt;= 2GB of memory the value for the private bytes limit will be set to 800MB*&lt;/p&gt;
&lt;p&gt;b.	For 32bit machines with &amp;gt; 2GB of memory the value for the private bytes limit will be set to 1800MB**&lt;/p&gt;
&lt;p&gt;i.	*The value set for private bytes or in the memory recycling used memory value will actually be set internally to 90% of whatever you set. &amp;nbsp;So the effective value for 800MB would become 720MB&lt;/p&gt;
&lt;p&gt;ii.	** this is what the developer said but in my testing I’ve found it sets it to 800MB in both cases. &amp;nbsp;The calculations are not done correctly.&lt;/p&gt;
&lt;p&gt;iii.	The default value for percentagePhysicalMemoryUsedLimit is 98%&lt;/p&gt;
&lt;p&gt;3.	If you set values in both places the lower value specified will take precedence. &amp;nbsp;If I set 600MB in IIS and 500MB in the web.config file for instance&lt;/p&gt;
&lt;p&gt;4.	These problems typically occur to the way memory is managed on the large object heap. &amp;nbsp;Memory on the large object heap is not recycled until the process itself is killed or recycled. &amp;nbsp;This is problematic if the process in question is still needing to reference objects that were in memory prior to the recycling. &amp;nbsp; If the memory recycling value is reduced instead of OutOfMemoryExceptions you will start to see NullReferenceExceptions.&lt;/p&gt;
&lt;p&gt;5.	For the larger memory machines I’ve tried setting the defaults to be 800MB for the used memory in IIS and I’ve tried the virtual memory setting of 1500MB. &amp;nbsp;Which should match the defaults on the 1GB machines. &amp;nbsp;Unfortunately doing so doesn’t reflect the same results as IIS 6.&lt;/p&gt;
&lt;p&gt;6.	To test the effective memory settings I created a simple web application with the following code that I used during testing C#&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Cache instance2 = &amp;nbsp;HttpContext.Current.Cache;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;long effectivepercentage = 0;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;long effectivebytes = 0; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;effectivepercentage = instance2.EffectivePercentagePhysicalMemoryLimit;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;effectivebytes = instance2.EffectivePrivateBytesLimit;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lblMemoryAvailable.Text = &amp;quot;Cache Settings: &amp;lt;BR&amp;gt;EffectivePercentagePhysicalMemoryLimit=(&amp;quot; + effectivepercentage.ToString() + &amp;quot;)&amp;lt;BR&amp;gt;EffectivePrivateBytesLimit=(&amp;quot; + (effectivebytes/1024/1024).ToString() + &amp;quot;MB)&amp;quot;;&lt;/p&gt;
&lt;p&gt;Is it possible to get some more testing done of these settings. &amp;nbsp;The recommended settings don't match the results of 1GB servers which I can prove. &amp;nbsp;Any additional insight or guidance is appreciated.&lt;/p&gt;
</description></item><item><title>re: Some history on the ASP.NET cache memory limits</title><link>http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-cache-memory-limits.aspx#9935224</link><pubDate>Thu, 10 Dec 2009 17:25:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9935224</guid><dc:creator>richardfremmerlid</dc:creator><description>&lt;p&gt;Additional note:&lt;/p&gt;
&lt;p&gt;I've tried modifying the effectivepercentagephysicalmemorylimit to match what is on a 1GB of memory. If it was 60% of 1GB, I also tried 600MB/4000GB or 600MB/3500GB to match the same amount of memory that way also.&lt;/p&gt;
&lt;p&gt;To me if these settings are done to match the lower memory servers, the testing results should match on each but they don't. &amp;nbsp;Moving to 64bit would resolve the issue, but that isn't a feasible option for us at this point.&lt;/p&gt;
</description></item><item><title>re: Some history on the ASP.NET cache memory limits</title><link>http://blogs.msdn.com/tmarq/archive/2007/06/25/some-history-on-the-asp-net-cache-memory-limits.aspx#9936743</link><pubDate>Mon, 14 Dec 2009 20:49:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9936743</guid><dc:creator>tmarq</dc:creator><description>&lt;p&gt;Richard wrote, &amp;quot;Code that works fine on our 1GB servers with Windows2003 would fail on machines with 3GB or 4GB with outofmemoryexceptions.&amp;quot;&lt;/p&gt;
&lt;p&gt;Richard, there is a bug in the v1.1 .NET Framework that causes ASP.NET to incorrectly handle the IIS 6.0 worker process (w3wp.exe) memory limit when it is 2GB or greater. &amp;nbsp;To work around this, I think you can explicitly set the memory limit so that it is below 2GB. &amp;nbsp;For a fix, please contact Microsoft Support or contact me via the Contacts page on my blog and I'll put you in contact with Microsoft Support.&lt;/p&gt;
</description></item></channel></rss>