If I had to guess, you appear to be out of memory. The game really needs a 64-bit build
The code in question is C#, neither the base game, nor any code that I would ever willingly touch is written in C#. So that leaves only those other 2 things you mentioned, one of them is written in C# (ick!).