April 2002
Intermediate to advanced
1024 pages
23h 26m
English
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 ...