JUnit default heap size overridden?

Hi,

I am trying to set the default max heap size for my JUnit tests by setting it in the 'defaults' section in the Run/Debug configurations.  I have set -Xmx2048m in 'VM options', and do indeed see that this argument is passed to the command line.  However, it seems to be overridden by something else and set back to 1024.  You can see this when monitoring the process in VisualVM and looking at the JVM arguments tab:

My configuration settings:

-ea  -Xmx2048m -XX:PermSize=256M -XX:MaxPermSize=384M -XX:-UseSplitVerifier -javaagent:"C:\Users\twebster\.ivy2\cache\org.springframework\spring-instrument\jars\spring-instrument-4.1.2.RELEASE.jar"

VisualVM JVM arguments:

-ea (mine)
-Xmx2048m (mine)
-XX:PermSize=256M (mine)
-XX:MaxPermSize=384M (mine)
-XX:-UseSplitVerifier (mine)
-javaagent:C:\Users\twebster\.ivy2\cache\org.springframework\spring-instrument\jars\spring-instrument-4.1.2.RELEASE.jar (mine)
-XX:-UseSplitVerifier (WHERE DID THIS COME FROM?)
-Xmx1024m (WHERE DID THIS COME FROM?)
-XX:MaxPermSize=256m (WHERE DID THIS COME FROM?)
-Didea.launcher.port=7537
-Didea.launcher.bin.path=D:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 14.1\bin
-Dfile.encoding=windows-1252


As you can see there are some other arguments that somehow got tacked on, and I have no idea where they came from.  Whatever the answer, it has the effect of overriding my values and I end up with a heap size of 1024m.

Anyone have any ideas?  I'm using Community Edition 14.1.3 build #IC-141.1010


4 comments
Comment actions Permalink

How do you run the tests? Is that a Maven project?

Can you share a sample project that will reproduce this?

0
Comment actions Permalink

Hi,

I'm just right-clicking a folder (src/test/java) in a Maven project and selecting 'Run tests in ....'.

It's a massive project so I can't share that, but I'll see if I can reproduce it in a smaller one....

0
Comment actions Permalink

Check your pom.xml files, Maven options defined for the tests override IDEA defaults, it's by design.

0
Comment actions Permalink

OK I will look..thanks.

0

Please sign in to leave a comment.