Large Object Heap (LOH)

Eintrag zuletzt aktualisiert am: 03.07.2013

Der Large Object Heap (LOH) ist ein Speicherbereich, den die .NET CLR verwendet, um Objekte zu speichern, die 85.000 Bytes oder mehr verbrauchen. Andere Objekte laden im Small Object Heap (SOH).

Microsoft hat in die Arbeitsweise des LOH in .NET 4.5 und .NET 4.5.1 verbessert, siehe

"In .NET 4.5, we made two improvements to the large object heap. First, we significantly improved the way the runtime manages the free list, thereby making more effective use of fragments. Now the memory allocator will revisit the memory fragments that earlier allocation couldn’t use. Second, when in server GC mode, the runtime balances LOH allocations between each heap. Prior to .NET 4.5, we only balanced the SOH. We’ve observed substantial improvements in some of our LOH allocation benchmarks as a result of both changes."
[http://blogs.msdn.com/b/dotnet/archive/2011/10/03/large-object-heap-improvements-in-net-4-5.aspx]

"We've taken the next logical step, by including LOH compaction in the .NET Framework 4.5.1 Preview. You can now instruct the GC to compact the LOH, either as part of the next natural GC or a forced GC, using the GC.Collect API. We hope that this solution resolves the remaining LOH issues."
[http://blogs.msdn.com/b/dotnet/archive/2013/06/26/announcing-the-net-framework-4-5-1-preview.aspx]