The IntelliJ IDEA 2016.3.2 update is almost here. We've just made available its RC build. Among the bugfixes that come with this build, there's a fix that addresses the out-of-memory problem that might occur when applying a patch. The problem should be gone none.
Please give the RC a thorough try…