I have found myself in a situation where I've got a 32-bit application that needs to allocate too much memory for the environment (constructing and serializing a very large Excel sheet - 80 columns, 200k rows, 3 sheets via ClosedXml).
Whilst I'm pretty sure some of the solution is going to need some re-writing of ClosedXml to include some ability to flush data to disk all at once, one approach I'm considering is spinning up a new process for the operation (even if it works completely it takes 10-20 mins to obtain the data, so I'm not too bothered about the overhead).
However, I'm not sure how to go about this. This question provides a link to do it using COM and Delphi, but firstly I'm in C# and secondly, I'd like to avoid COM if possible (or, put more precisely, I'd like to avoid the garbage collection headache that is interop if possible; if it's just a matter of inheriting from MarshalByRefObject
or similar, then that's fine).
Any suggestions?