RESOLVED check below for solution.
I\'m using Intellij Idea 2017.2.2. Below is my intellij Specs.
My Intellij would only occasionally fail a maven build or a jbo
I had to do the following options to get it pass the error.
Spec used: IDEA IntelliJ 2019.3.5 (Community Edition)
Increase the memory in IntelliJ VM Options
Step 1: Go to Help -> Edit Custom VM Options
Step2: Change the Heap sizes as given below
Run the app with increased memory by setting the VM options
Run -> Edit Configurations
Ultimately I was able to resolve the issue by updating the proper JDK. My project was picking up on an incorrect JDK and hence was running the 32 Bit as opposed to 64 bit JDK.
Simply added the correct JDK under File > Project Settings.
It seemed that my project never required that much memory before, but once the need had risen, it seems that a 64 bit became required.
I have solved this problem by changing the build settings in Intellij. Please follow the below steps.
For SBT: 1. Go to File -> Settings -> Build, Execution Deployment -> sbt 2. Change the value of Maximum heap size, MB to your available memory. Ex. 512 (Previously this value was 1536, due to this I faced the problem)
For Maven: 1. Go to File -> Settings -> Build, Execution Deployment -> Maven -> Importing