Search code examples
javaintellij-ideagarbage-collection

Conflicting collector combinations using G1 & IntelliJ 2017.1 on OSX


I'm trying to configure garbage collection with Intellij Community Edition 2017.1. Using the following /Users/jilles/Library/Preferences/IdeaIC2017.1/idea.vmoptions

# custom IntelliJ IDEA VM options

-XX:+UseG1GC

It refuses to start with this. The above file only has 1 option that should turn on the G1. I simply removed options until I found which one was causing the issues. After some digging, I managed to at least get it to tell me why on the command line (this stuff never ends up in the log):

~/Library/Preferences/IdeaIC2017.1 $ /Applications/IntelliJ\ IDEA\ CE.app/Contents/MacOS/idea
2017-04-14 13:41:52.697 idea[54761:1579154] allVms required 1.8*,1.8+
2017-04-14 13:41:52.701 idea[54761:1579163] fullFileName is: /Applications/IntelliJ IDEA CE.app/Contents/bin/idea.vmoptions
2017-04-14 13:41:52.701 idea[54761:1579163] fullFileName exists: /Applications/IntelliJ IDEA CE.app/Contents/bin/idea.vmoptions
2017-04-14 13:41:52.701 idea[54761:1579163] Value of IDEA_VM_OPTIONS is (null)
2017-04-14 13:41:52.701 idea[54761:1579163] Processing VMOptions file at /Users/jilles/Library/Preferences/IdeaIC2017.1/idea.vmoptions
2017-04-14 13:41:52.702 idea[54761:1579163] Done
Conflicting collector combinations in option list; please refer to the release notes for the combinations allowed
2017-04-14 13:41:52.710 idea[54761:1579163] JNI_CreateJavaVM (/Applications/IntelliJ IDEA CE.app/Contents/jdk) failed: 4294967295

The release notes seem to actually consist of a list of issues that were fixed, none of which seem to be about garbage collection.

Is the G1 garbage collector not supported in intellij? What are those conflicting settings and where are they configured or why is this not allowed? What are the current, up to date, recommendations for GC config for intellij? I'm sorry to ask since this seems a hotly debated topic in the context of intellij but pretty much all of the stuff I found related to this is for ancient versions of java + intellij. Google seems to happily suggest articles dating back to 2006 on this, which is less than helpful.

/Applications/IntelliJ IDEA CE.app/Contents/bin/idea.vmoptions does not configure any garbage collection stuff and comes with some strangely low heap size defaults that almost certainly will need some level of tweaking:

-Xms128m
-Xmx750m
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOops

Solution

  • I haven't tried this yet, but I'd suspect (as you apparently do) that it conflicts with another GC configuration.

    Have you tried to turn the other ones off to cancel out any other options that could have been added by a parent configuration, e.g. by doing something like:

    -XX:-UseParallelGC
    -XX:-UseConcMarkSweepGC
    -XX:+UseG1GC
    

    Update: