[Java] What to see when IntelliJ doesn’t start on Mac

1 minute read

IntelliJ was so heavy that I couldn’t use it, so I messed with VMOption and it stopped working …
I’ve repaired it, so I’ll leave it at the memo level so I don’t forget it.

Launch directly from the terminal

console


/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea 
2020-01-09 13:20:00.633 idea[24470:651890] allVms required 1.8*,1.8+
2020-01-09 13:20:00.636 idea[24470:651896] Value of IDEA_VM_OPTIONS is (null)
2020-01-09 13:20:00.636 idea[24470:651896] Processing VMOptions file at /Users/hisayuki/Library/Preferences/IntelliJIdea2019.3/idea.vmoptions
2020-01-09 13:20:00.636 idea[24470:651896] Done
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Error occurred during initialization of VM
Multiple garbage collectors selected

In case of error, it is likely that the memory setting of the VM
At this time, it was a mistake to add the options -XX: + UseG1GC and -XX: -UseParNewGC.

Modify VM Option

console


vi /Users/<MAC users>/Library/Preferences/IntelliJIdea2019.3/idea.vmoptions

Before correction

-Xms2G
-Xmx4G
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Xverify:none

-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof

-XX:+UseG1GC
-XX:-UseParNewGC

Revised

-Xms2G
-Xmx4G
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Xverify:none

-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof

(Reference) How to check the default value

If you don’t know, you can return to the default value for the time being, so this is a reference method.

$ cat /Applications/IntelliJ\ IDEA.app/Contents/bin/idea.vmoptions 
-Xms128m
-Xmx750m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Djdk.attach.allowAttachSelf=true
-Dkotlinx.coroutines.debug=off
-Djdk.module.illegalAccess.silent=true
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8