I am trying to run JUnits from my IntelliJ Idea When I try to run the Test.java file it gives me an error saying that
java: OutOfMemoryError: insuffic
Idea runs unit tests in a separate java process.
You need to use
Run -> Edit Configurations...
and add your -XmxNNNm to VM Options.
-XmxNNNm
For example:
-ea -Xmx1024m
The "-ea" means "enable assertions".
If your unit test(s) can't run in a 1GB of memory then it's possible that you have a memory leak.