I think this is the compiler running out of memory because it’s a 32-bit application and it can only allocate 2Gb.
The experimental 3.7.0 version of the arduino-proffieboard plugin has a 64-bit compiler, and might work better.
Instructions for how to install it here: