In my job we had a problem with OutOfMemoryExceptions. I\'ve written a simple piece of code to mimic some behavior, and I\'ve ended up with the following mystery. Look at this s
I had similar problem in .NET with the difference my byte[] had random sizes.
i tried two ways:
write an own heap manager (alloc memory with one large buffer and just adjust pointers)
use a memory mapped file (in my opinion the better solution)
If possible you can try out .NET 4.5 http://blogs.msdn.com/b/dotnet/archive/2012/07/20/the-net-framework-4-5-includes-new-garbage-collector-enhancements-for-client-and-server-apps.aspx