0

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?

Community
  • 1
  • 1
tobriand
  • 1,095
  • 15
  • 29
  • 1
    I'd use [WCF (Windows Communication Foundation)](https://msdn.microsoft.com/en-us/library/ms731082%28v=vs.110%29.aspx) to do this. It allows calling of C# methods in a different process, and you can call 64-bit from 32-bit and vice-versa. There's a bit of a learning curve though... – Matthew Watson Aug 12 '15 at 09:11
  • Thanks for that - will look into it. I've needed to learn this for some time, but didn't think of it for this purpose (which is probably silly of me). Will give it a look. – tobriand Aug 12 '15 at 13:53

0 Answers0