<?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>ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx</link><description>ASP.NET Memory: Thou shalt not store UI objects in cache or session scope Surprisingly the issue I wrote about in &amp;quot; the eventhandlers that made the memory baloon &amp;quot; (Jan 2006) is something that still happens very frequently, I reference it in</description><dc:language>sv-SE</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8556621</link><pubDate>Wed, 28 May 2008 17:46:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8556621</guid><dc:creator>Bruno Aleixo</dc:creator><description>&lt;p&gt;Hello Tess,&lt;/p&gt;
&lt;p&gt;is the !dumpheap -type aspx specific to a SOS version ?&lt;/p&gt;
&lt;p&gt;I tried that and i get 0 items, but in my dumpheap -stat i can see i have a lot aspx&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8556629</link><pubDate>Wed, 28 May 2008 17:53:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8556629</guid><dc:creator>Tess</dc:creator><description>&lt;p&gt;in some versions you have to run !dumpheap -type *aspx*&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8556723</link><pubDate>Wed, 28 May 2008 19:29:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8556723</guid><dc:creator>Bruno Aleixo</dc:creator><description>&lt;p&gt;Do you know in dumpheap -stat what -1 in GEN means ?&lt;/p&gt;
&lt;p&gt;0x0a402814 0x18d04bc4 &amp;nbsp; &amp;nbsp; &amp;nbsp;256 &amp;nbsp; -1 _ASP.ReportOpPendentes_aspx &lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8557331</link><pubDate>Thu, 29 May 2008 09:27:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8557331</guid><dc:creator>Tess</dc:creator><description>&lt;p&gt;You shouldnt get the gen column with !dumpheap -stat, probably with some other switch for !dumpheap since the gen is only displayed for individual objects.&lt;/p&gt;
&lt;p&gt;I believe it means it has already been garbage collected.&lt;/p&gt;
&lt;p&gt;You would usually see it if you try to dump out objects outside of the currently used areas of the heap. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you get it with normal !dumpheap -type ... or !dumpheap -mt ..., make sure that you are using the sos that comes with the framework.&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8557432</link><pubDate>Thu, 29 May 2008 11:29:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8557432</guid><dc:creator>Bruno Aleixo</dc:creator><description>&lt;p&gt;You are right, it was with dumpheap -mt and not -stat. This is something that always confuses me. If it&amp;#180;s already Garbage collected why is it still around ? Because if i do a gcroot i get no root for those objects &lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8557471</link><pubDate>Thu, 29 May 2008 11:59:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8557471</guid><dc:creator>Tess</dc:creator><description>&lt;p&gt;it just hasn't been marked as free yet, perhaps it is in the middle of a garbage collection, or there is something wrong so that you are enumerating items that are outside of the bounds of the currently allocated memory.&lt;/p&gt;
&lt;p&gt;I would have to look at the exact details to give you any further answers... &lt;/p&gt;
</description></item><item><title>Link Listing - May 29, 2008</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8561388</link><pubDate>Fri, 30 May 2008 06:33:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8561388</guid><dc:creator>Christopher Steen</dc:creator><description>&lt;p&gt;AJAX Cool ScriptManager stuff I missed... [Via: Jay Kimble ] ASP.NET ASP.NET Memory: Thou shalt not...&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8567705</link><pubDate>Sun, 01 Jun 2008 17:54:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8567705</guid><dc:creator>Brian Hartung</dc:creator><description>&lt;p&gt;You'd think by now someone would have thought to turn this into a compiler warning or MDA as often as the issue &amp;nbsp;comes up.&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8641947</link><pubDate>Mon, 23 Jun 2008 16:09:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8641947</guid><dc:creator>Flüge Vancouver</dc:creator><description>&lt;p&gt;many, many thanks. that was exactly our problem here. Now we fixed it with your help!!! Many thanks!&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8648376</link><pubDate>Tue, 24 Jun 2008 21:44:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8648376</guid><dc:creator>kjopc</dc:creator><description>&lt;p&gt;I'm wondering if this technique could be used to create a tool to evaluate the amount of memory required for one user's Session state?&lt;/p&gt;
&lt;p&gt;I'm working on an ASP.NET application that stores a lot of data in a Session and I'm concerned about how this will scale as the company adds customers. It would be great to know the exact resources a single user requires. That way, we'd know whether to rebuild or just add memory to cope with expansion.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Ken&lt;/p&gt;
&lt;p&gt;MVP [ASP.NET]&lt;/p&gt;</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8648925</link><pubDate>Tue, 24 Jun 2008 23:28:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8648925</guid><dc:creator>Tess</dc:creator><description>&lt;p&gt;you can always use something like this &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/tess/archive/2007/09/18/debugging-script-dumping-out-asp-net-session-contents.aspx"&gt;http://blogs.msdn.com/tess/archive/2007/09/18/debugging-script-dumping-out-asp-net-session-contents.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8828753</link><pubDate>Mon, 04 Aug 2008 10:38:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8828753</guid><dc:creator>Dirk</dc:creator><description>&lt;p&gt;On a related theme.&lt;/p&gt;
&lt;p&gt;I have a question regarding the MVP pattern that has become so popular of late.&lt;/p&gt;
&lt;p&gt;One of the ideas behind the pattern is passing around a view. Often the view can be a whole ASP.net page.&lt;/p&gt;
&lt;p&gt;I was wondering what the performance implications of this are as there must be a lot of information being transfered around that does not need to.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8834050</link><pubDate>Tue, 05 Aug 2008 16:54:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8834050</guid><dc:creator>Tess</dc:creator><description>&lt;p&gt;are you talking about MVC (Model View Controller)?&lt;/p&gt;
&lt;p&gt;If so, I think the story is a little bit different. &amp;nbsp;You wouldnt be passing around controls that have ties back to the page necessarily. &amp;nbsp;If you do then that might be an issue... &amp;nbsp;to be really honest I haven't really looked into it enough to know what the details are and what the implications would be. &amp;nbsp;Once I get there I'll make sure to post about it though... &lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8834185</link><pubDate>Tue, 05 Aug 2008 18:00:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8834185</guid><dc:creator>Dirk</dc:creator><description>&lt;p&gt;Thanks for the reply!&lt;/p&gt;
&lt;p&gt;Yes the MVP is a slightly different take on the MVC pattern but they have essentially the same goal; seperation of concerns.&lt;/p&gt;
&lt;p&gt;I guess I should stop being lazy and fire up windbg and have a look myself. &lt;/p&gt;
&lt;p&gt;Any tips on what to look for?&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8890631</link><pubDate>Sat, 23 Aug 2008 19:29:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8890631</guid><dc:creator>Rob</dc:creator><description>&lt;p&gt;Would I see this issue if storing Control instances in the HttpContext.Item Collection. &amp;nbsp;I know the Context dies at the end of the request, but would it delay the garbage collection of the control and associated parent?&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8890733</link><pubDate>Sat, 23 Aug 2008 23:07:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8890733</guid><dc:creator>Tess</dc:creator><description>&lt;p&gt;Rob,&lt;/p&gt;
&lt;p&gt;No you shouldn't, this would only happen if you store it in some type of long term storage like cache/session scope/static arrays etc. &lt;/p&gt;
</description></item><item><title>ASP.NET Memory Issues - High Memory Usage with AjaxPro (fixed in current version)</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8951732</link><pubDate>Sun, 14 Sep 2008 18:05:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8951732</guid><dc:creator>If broken it is, fix it you should</dc:creator><description>&lt;p&gt;I was helping a colleague out with an OOM (OutOfMemory) situation he was dealing with. Problem description:&lt;/p&gt;
</description></item><item><title>Don't store ASP.NET controls in Session, Application or Cache</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#8960494</link><pubDate>Sun, 21 Sep 2008 14:12:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8960494</guid><dc:creator>Readed By Wrocław NUG members</dc:creator><description>&lt;p&gt;In some cases you may end up with the following exception when working with RadControls for ASP.NET Ajax&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#9243303</link><pubDate>Sat, 20 Dec 2008 05:44:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9243303</guid><dc:creator>Houston Nightclubs</dc:creator><description>&lt;p&gt;In your article you talk about how its not good to store too much in the cache. &amp;nbsp;In my case I am only storing long strings in my cache. &amp;nbsp;I even built a page that allows me to view my cached objects and keep track on how much data my cache is consuming. &amp;nbsp;How much would be too much for the cache if my VPS has 1GB or ram? &amp;nbsp;Also is the cache stored in the W3WP.exe? or is it stored in the aspnet_state.exe process when using a web garden? &amp;nbsp;Great articles by the way&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#9244572</link><pubDate>Sun, 21 Dec 2008 01:51:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9244572</guid><dc:creator>Tess</dc:creator><description>&lt;p&gt;Only you can decide how much is too much... and to figure out how much is too much you will have to consider how much RAM you have vs. how many processes you are running on this system and how much memory they are consuming. &amp;nbsp;You should also consider doing stress tests if you are caching very much, to see if the gain you are getting from caching superscedes that of building the cache. &amp;nbsp;For example if the cache is built at the beginning of the process this might mean long startup times for the process.&lt;/p&gt;
&lt;p&gt;Another thing to consider is that as the cache grows larger it takes longer to look through the cache to get your data. &amp;nbsp;The point at which this causes an issue for you depends a lot on what you store in cache, how much you store and how long it takes to get those items if not cached.&lt;/p&gt;
&lt;p&gt;In this particular case study the issue is not so much storing known items in cache, but rather storing UI objects and not expecting to also cache the items the UI objects reference. &lt;/p&gt;
</description></item><item><title>Developers are from Mars, Ops people are from Venus… or It looked good on paper</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#9530660</link><pubDate>Fri, 03 Apr 2009 16:57:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9530660</guid><dc:creator>If broken it is, fix it you should</dc:creator><description>&lt;p&gt;A few weeks back me and Micke (one of our Architect Evangelists) had a session at TechDays where we talked&lt;/p&gt;
</description></item><item><title>Debug Diag script for troubleshooting .NET 2.0 Memory leaks</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#9606676</link><pubDate>Tue, 12 May 2009 12:59:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9606676</guid><dc:creator>If broken it is, fix it you should</dc:creator><description>&lt;p&gt;I have put together a quick and dirty debug diag script for troubleshooting .net memory leaks. (attached&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#9805309</link><pubDate>Fri, 26 Jun 2009 15:12:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805309</guid><dc:creator>cisjokey</dc:creator><description>&lt;p&gt;I just don't understand your problem.&lt;/p&gt;
&lt;p&gt;&amp;quot;the application stored UI controls in session scope, &amp;quot;&lt;/p&gt;
&lt;p&gt;Your application?&lt;/p&gt;
&lt;p&gt;I hope you were not adding the complete instance of the control to the viewstate?&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#9805324</link><pubDate>Fri, 26 Jun 2009 15:21:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805324</guid><dc:creator>Tess</dc:creator><description>&lt;p&gt;cisjokey,&lt;/p&gt;
&lt;p&gt;Well not mine:) &amp;nbsp;but a lot of my customers... they weren't adding them to viewstate, but to session state.&lt;/p&gt;
</description></item><item><title>re: ASP.NET Memory: Thou shalt not store UI objects in cache or session scope</title><link>http://blogs.msdn.com/tess/archive/2008/05/28/asp-net-memory-thou-shalt-not-store-ui-objects-in-cache-or-session-scope.aspx#9805430</link><pubDate>Fri, 26 Jun 2009 16:29:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805430</guid><dc:creator>cisjokey</dc:creator><description>&lt;p&gt;Ok, I really wondered about ... :-)&lt;/p&gt;
&lt;p&gt;May be the force with you&lt;/p&gt;
</description></item></channel></rss>