Practice First

实践第一

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

The danger of large object heap

There are two kinds of segments in CLR managed heap.

Small object heap is used for storing small object whose size is less than 8500 kb. When the GC collects dead object, it will compact the SOH by moving the objects.

Large object heap is used  for string large object whose size is more than 8500 kb. After GC collects dead objects, it will not compact the LOH, because moving large object cost a lot.

So if you don’t take carefully to use large objects. It will cause a lot of memory fragments. This might cause the exception of OutOfMemoryException.

 

If you are interested in this topics, please read these post:

http://msdn.microsoft.com/en-us/magazine/cc534993.aspx

http://www.simple-talk.com/dotnet/.net-framework/the-dangers-of-the-large-object-heap/

posted on 2009-09-25 15:19  caoshenghe  阅读(246)  评论(0编辑  收藏  举报