O'Reilly logo

.NET Common Language Runtime Unleashed by Kevin Burton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Large Objects

You need to be aware of one more optimization. If an object is larger than 20,000 bytes, then it is allocated from the large object heap. The heap looks identical programmatically to the managed heap for smaller objects. An object in the large object heap ages through three generations, just like an object in the managed heap for small objects. The same rules apply for finalization of large objects as for small objects. The CLR makes one distinction in handling objects in the large object heap versus the managed heap for small objects: After objects in the large object heap are freed, the CLR does not try to compact the objects in the heap.

Two samples have been built in the LargeObject and LOC subdirectories that allocate a large ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required