The Open Closed Principle
Patterns in Practice: The Open Closed Principle by Jeremy Miller
Build Scalable Systems That Handle Failure Without Losing Data by Udi Dahan
Labels: failure, losing data, scalable
For LOH, though, because compaction is expensive the CLR team chose to sweep them, making a free list out of dead objects that can be reused later to satisfy large object allocation requests. Adjacent dead objects are made into one free object.
LOH Performance Implications
Allocation costs.The CLR makes the guarantee that the memory for every new object I give out is cleared. This means the allocation cost of a large object is completely dominated by memory clearing (unless it triggers a garbage collection). If it takes two cycles to clear 1 byte, it means it takes 170,000 cycles to clear the smallest large object. For a 16MB object on a 2GHz machine, it will take approximately 16ms to clear the memory.
Collection costs. LOH and generation 2 are collected together. If either one's threshold is exceeded, a generation 2 collection will be triggered. If many large objects are allocated on a very temporary basis and you have a big SOH, you could be spending too much time running garbage collections; not to mention that the allocation cost can really add up if you keep allocating and letting really large objects go.
From Large Object Heap Uncovered by Maoni Stephens.