Is it possible in .Net to create "custom" heap, allocate objects on this heap and dispose it deterministically without running GC?
Why?
I have a lot of large text files loaded into memory as strings and they should be in memory until end of processing. After finishing processing I would like to dispose all these strings but they are not disposable in .Net. Since there are lot of big objects created during loading the GC works hard and most of objects finish sitting on Gen2 (and LOH) that can take too much time until GC will perform automatic collection. I can call GC.Collect() to free memory but pressure on GC during loading is still a problem.
I would like to tell the runtime to allocate all these strings in no-GC-aware memory block and dispose this block deterministically after processing finish.