Saturday, July 5, 2008

Large Object Heap Uncovered

After reading through the chapter 20 in CLR via C#, automatic memory management, if you want to learn more about the topic, the MSDN article, Large Object Heap Uncovered picks up what the book left.

According to the author, Objects larger than 85KB are considered as large objects in CLR, and are allocated in the large object heap(LOH), rather than the usual small objects heap. In object allocation, since the memory CLR gives out is cleared, it takes longer time to clear the memory for a large object. On the other hand, large objects are generation 2 objects. So a generation 2 object collection causes all objects, both large and small, get collected.

To speed up the garbage collection in LOH, dead objects in LOH are marked and the space is put into a free list for later allocation. There is no compaction. However, because of this 'feature', frequent temporary large object release and allocation can cause virtual memory fragmentation.

One way to avoid frequent memory allocation and release and subsequent VM fragmentation is to build a object pool by oneself and reuse the objects in the pool instead of creating temporary ones. One can find an implementation here.

Another approach is utilizing VM Hoarding, supported in CLR 2.0. When enabled via hosting API, unused memory segments are not released to OS and are put on a standby list. When new memory segments are requested, the standby list is searched first. However, VM hoarding should be used with caution. it is advised that using this feature, you should test your application to make sure a stable memory usage.

Further Readings:
Maoni's WebLog - CLR Garbage Collector
CLR Inside Out: Large Object Heap Uncovered

3 comments:

Anonymous said...

It's actually 85000 bytes, not 85kb.

Anonymous said...

[u][b]Xrumer[/b][/u]

[b]Xrumer SEO Professionals

As Xrumer experts, we secure been using [url=http://www.xrumer-seo.com]Xrumer[/url] fitted a large fix for the time being and know how to harness the colossal power of Xrumer and adapt it into a Banknotes machine.

We also purvey the cheapest prices on the market. Numberless competitors desire order 2x or consistent 3x and a end of the continuously 5x what we debt you. But we maintain in providing prominent mending at a small affordable rate. The entire incidental of purchasing Xrumer blasts is because it is a cheaper variant to buying Xrumer. So we plan to keep that contemplating in recollection and afford you with the cheapest grade possible.

Not only do we be suffering with the greatest prices but our turnaround occasion payment your Xrumer posting is wonderful fast. We compel secure your posting done ahead of you distinguish it.

We also provide you with a full log of successful posts on contrasting forums. So that you can notice seeking yourself the power of Xrumer and how we get harnessed it to gain your site.[/b]


[b]Search Engine Optimization

Using Xrumer you can wish to see thousands upon thousands of backlinks exchange for your site. Scads of the forums that your Place you settle upon be posted on have exalted PageRank. Having your association on these sites can truly help build up some top quality recoil from links and as a matter of fact riding-boot your Alexa Rating and Google PageRank rating through the roof.

This is making your instal more and more popular. And with this better in regard as familiarly as PageRank you can envisage to see your milieu definitely superiority expensive in those Search Motor Results.
Conveyance

The amount of conveyance that can be obtained by harnessing the power of Xrumer is enormous. You are publishing your site to tens of thousands of forums. With our higher packages you may regular be publishing your locality to HUNDREDS of THOUSANDS of forums. Ponder 1 brief on a all the rage forum drive inveterately get 1000 or so views, with communicate 100 of those people visiting your site. These days create tens of thousands of posts on celebrated forums all getting 1000 views each. Your see trade longing function because of the roof.

These are all targeted visitors that are interested or curious about your site. Imagine how assorted sales or leads you can execute with this considerable figure up of targeted visitors. You are literally stumbling upon a goldmine friendly to be picked and profited from.

Reminisce over, Traffic is Money.
[/b]

TRAVERSE B RECOVER YOUR INFERIOR ERUPTION TODAY:


http://www.xrumer-seo.com

mahakk01 said...

This post gives you brief idea about large objects which leads to large object heap. The concept is given in simple terms so you won't find it difficult. I find this topic quite interesting and I want to know more about it.
sap testing