It is an absolute disgrace that LOH compaction is not included in the CLR (GC). Please make every effort to include this feature in future versions
I don't care how long it takes to perform a large object heap compaction, please just give us the option to do it
Thanks for the great suggestion. We’ve announced support for this in .NET Framework 4.5.1: http://blogs.msdn.com/b/dotnet/archive/2013/06/26/announcing-the-net-framework-4-5-1-preview.aspx.
This feature is absolutely essential for our software. We render WPF images on background threads, use large BitmapSource's, very large arrays (6 million long), and even though our memory usage is 300 MB, we get OOM exceptions due to LOH fragmentation. Thanks for implementing this feature!
GC compaction uses a very low-level memcpy C runtime command which becomes more expensive as the amount of memory being moved increases. The LOH is given special treatment to not compact so it avoids this performance hit. It also has a lot of logic to reuse the "holes" created by freeing memory in the LOH so compaction isn't as important.