<?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>I Am a Happy Janitor – Part 1: Finding garbage</title><link>http://blogs.msdn.com/b/maoni/archive/2006/08/18/i-am-a-happy-janitor-part-1-finding-garbage.aspx</link><description>Indeed what I do is very much like the job of the janitors – like the ones who clean your building, or janitors you see at a food court, or yourself when you are taking care of garbage at your house. Doubtful you say? Let me prove it to you. 
 
 Finding</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: I Am a Happy Janitor – Part 1: Finding garbage</title><link>http://blogs.msdn.com/b/maoni/archive/2006/08/18/i-am-a-happy-janitor-part-1-finding-garbage.aspx#10256196</link><pubDate>Fri, 13 Jan 2012 05:25:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10256196</guid><dc:creator>Anil</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We have an enterprise level system that is currently build on .NET2.0. Lately we shifted the target to .NET 4.0. The system is primarily a desktop system. After shifting the target to .NET 4.0 we have found that the average memory consumed per client has increased substantially, esp. in the CITRIX environment. Yes, the way GC works has been modified in .NET 4.0, but could this be the cause of the higher memory consumed.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10256196" width="1" height="1"&gt;</description></item><item><title>Troubleshooting System.OutOfMemoryExceptions in ASP.NET</title><link>http://blogs.msdn.com/b/maoni/archive/2006/08/18/i-am-a-happy-janitor-part-1-finding-garbage.aspx#9678325</link><pubDate>Mon, 01 Jun 2009 18:28:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9678325</guid><dc:creator>Useful IIS/ASP.NET Information provided by Microsoft Support Teams</dc:creator><description>&lt;p&gt;Some common causes of OutOfMemoryExceptions in ASP.NET applications and information on how to resolve these exceptions.&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9678325" width="1" height="1"&gt;</description></item><item><title>re: I Am a Happy Janitor – Part 1: Finding garbage</title><link>http://blogs.msdn.com/b/maoni/archive/2006/08/18/i-am-a-happy-janitor-part-1-finding-garbage.aspx#9259342</link><pubDate>Thu, 01 Jan 2009 08:33:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9259342</guid><dc:creator>Mike Waldrop</dc:creator><description>&lt;p&gt;I thought I had a pretty good handle on the GC until I started using the DumpGen command in SOSEX. &amp;nbsp;In my testing I found that during a GC, the memory in Gen 0 was not being freed. &amp;nbsp;Or at least that is how it appears.&lt;/p&gt;
&lt;p&gt;I was purposely doing a GC.Collect to see what got left over in trying to see what had some objects locked.&lt;/p&gt;
&lt;p&gt;What I found interesting is this. &amp;nbsp;Many instances of aspx pages and other objects still existed in Gen 0 after I did a collect. &amp;nbsp;BUT here is the weird part.&lt;/p&gt;
&lt;p&gt;First I did a GC.Collect then ran the below commands expecting the same result. &amp;nbsp;I was always told after a GC gen 0 is practically 0.&lt;/p&gt;
&lt;p&gt;This command: !dumpheap -type ASP.MyPage (or any obect)&lt;/p&gt;
&lt;p&gt;showed collection working as expected. &amp;nbsp; But then I used the SOSEX command of&lt;/p&gt;
&lt;p&gt;!dumpgen 0 -type ASP.MyPage &lt;/p&gt;
&lt;p&gt;and there were tons of instances consuming memory. &amp;nbsp;Even after doing a collection. &amp;nbsp;Perhaps I'm thinking of it wrong. &amp;nbsp;I thought when a gen0 happens object moved to gen1 if needed, object that can be collected are and then compaction. &amp;nbsp;And the pointer to gen0 reset.&lt;/p&gt;
&lt;p&gt;I assumed the blocks that are removed are actually emptied But maybe this is where I am confused. &amp;nbsp;If the pointer is moved then maybe those blocks are just overriden and the SOSEX tool however it works is just finding these?&lt;/p&gt;
&lt;p&gt;Seems strange though. &amp;nbsp;When I create dumps they are in the 200 meg range but yet the eeheap -gc tells me that it's only a few megs. &amp;nbsp;And the total bytes in heaps counter jives more with the 200 megs.&lt;/p&gt;
&lt;p&gt;So is the memory in gen 0 actually freed? &amp;nbsp;Or is the SOSEX tool just showing me incorrect data.&lt;/p&gt;
&lt;p&gt;Oh and Happy New Year, as I see it's 12:15 am.&lt;/p&gt;
&lt;p&gt;if you could email me that would be great. &amp;nbsp;jedi1_9_7_3@yahoo.com&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9259342" width="1" height="1"&gt;</description></item><item><title>re: I Am a Happy Janitor – Part 1: Finding garbage</title><link>http://blogs.msdn.com/b/maoni/archive/2006/08/18/i-am-a-happy-janitor-part-1-finding-garbage.aspx#9000154</link><pubDate>Wed, 15 Oct 2008 02:15:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9000154</guid><dc:creator>Maoni Stephens</dc:creator><description>&lt;p&gt;Gourav, so what does CLRProfiler about what contributes to the growth of the heap?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9000154" width="1" height="1"&gt;</description></item><item><title>re: I Am a Happy Janitor – Part 1: Finding garbage</title><link>http://blogs.msdn.com/b/maoni/archive/2006/08/18/i-am-a-happy-janitor-part-1-finding-garbage.aspx#8616057</link><pubDate>Wed, 18 Jun 2008 14:59:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8616057</guid><dc:creator>Gourav</dc:creator><description>&lt;p&gt;Maoni,&lt;/p&gt;
&lt;p&gt;I really appreciate this Weblog. Thanks A lot !!&lt;/p&gt;
&lt;p&gt;I have one windows service which use System.Timers.Timer to Create Process in interval of 5 sec on each elapse Event memory is increasing by 4 KB, I used CLRProfiler and found heap is growing like any thing.&lt;/p&gt;
&lt;p&gt;Please help me to solve this problem ?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8616057" width="1" height="1"&gt;</description></item><item><title>re: I Am a Happy Janitor – Part 1: Finding garbage</title><link>http://blogs.msdn.com/b/maoni/archive/2006/08/18/i-am-a-happy-janitor-part-1-finding-garbage.aspx#777885</link><pubDate>Sat, 30 Sep 2006 09:46:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:777885</guid><dc:creator>Maoni Stephens</dc:creator><description>Raghu, I can not comment on this since legally we (as in product groups) are not allowed to run benchmarks on our competitor products.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=777885" width="1" height="1"&gt;</description></item><item><title>re: I Am a Happy Janitor – Part 1: Finding garbage</title><link>http://blogs.msdn.com/b/maoni/archive/2006/08/18/i-am-a-happy-janitor-part-1-finding-garbage.aspx#777716</link><pubDate>Sat, 30 Sep 2006 05:16:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:777716</guid><dc:creator>Raghu</dc:creator><description>Hi,&lt;br&gt;&lt;br&gt;Do you have any plans to benchmark .net framework 2.0 with BEA WebLogic Real Time &amp;nbsp;(WLRT) 1.1 . They are boasting &amp;quot;deterministic&amp;quot; GC. &amp;nbsp;There is a lot of hype out there....&lt;br&gt;&lt;br&gt;Can you comment on this...&lt;br&gt;&lt;br&gt;Thanks.&lt;br&gt;Raghu/..&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=777716" width="1" height="1"&gt;</description></item><item><title>re: I Am a Happy Janitor – Part 1: Finding garbage</title><link>http://blogs.msdn.com/b/maoni/archive/2006/08/18/i-am-a-happy-janitor-part-1-finding-garbage.aspx#751058</link><pubDate>Tue, 12 Sep 2006 23:14:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:751058</guid><dc:creator>Maoni Stephens</dc:creator><description>Mark, as you said&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt;Personally, I think the GC should automatically get called when an AppDomain is unloaded, but I can see why it might not as well. &lt;br&gt;&lt;br&gt;For the CLR since we need our stuff to work for a very wide range of scenarios we don't do that. As a matter of fact we used to trigger a GC on AD unload but there was perf problems with it so we didn't do that anymore. &lt;br&gt;&lt;br&gt;For your own scenario, if you are completely in control when you unload appdomains and you don't do it often it's ok to induce GC yourself. I certainly would not recommand it as a general solution.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=751058" width="1" height="1"&gt;</description></item><item><title>re: I Am a Happy Janitor – Part 1: Finding garbage</title><link>http://blogs.msdn.com/b/maoni/archive/2006/08/18/i-am-a-happy-janitor-part-1-finding-garbage.aspx#750981</link><pubDate>Tue, 12 Sep 2006 22:24:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:750981</guid><dc:creator>Mark E.</dc:creator><description>Maoni,&lt;br&gt;&lt;br&gt;Thank you for your response. That is an interesting idea. The documentation (understandably) is very thin. I did find the solution to my problem that will not require such explicit memory control.&lt;br&gt;&lt;br&gt;For the sake of other who may struggle with this topic, I'll include our solution...&lt;br&gt;&lt;br&gt;My application's architecture is based on dynamically loading AppDomains which will then dynamically load plugins. All I had to do was to add a specific call to &amp;quot;GC.Collect();&amp;quot; at the point when the AppDomain was unloaded. This keeps the memory growth in check. It's the perfect time to call it as all the DLLs and objects have been freed with the AppDomain.&lt;br&gt;&lt;br&gt;Personally, I think the GC should automatically get called when an AppDomain is unloaded, but I can see why it might not as well. At any rate, this allows us to keep a managable baseline memory footprint that a customer can see and understand.&lt;br&gt;&lt;br&gt;Thanks for your help!&lt;br&gt;-Mark E.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=750981" width="1" height="1"&gt;</description></item><item><title>re: I Am a Happy Janitor – Part 1: Finding garbage</title><link>http://blogs.msdn.com/b/maoni/archive/2006/08/18/i-am-a-happy-janitor-part-1-finding-garbage.aspx#749830</link><pubDate>Mon, 11 Sep 2006 22:28:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:749830</guid><dc:creator>Maoni Stephens</dc:creator><description>Hi Mark, take a look at IGCHostControl::RequestVirtualMemLimit:&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://msdn2.microsoft.com/en-us/library/ms404403.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms404403.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;The IHostMemoryManager interface may also be of interest to you. For example, if you implement IHostMemoryManager::VirtualAlloc, when GC calls VirtualAlloc it will go through your implementation.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=749830" width="1" height="1"&gt;</description></item></channel></rss>