IntelliJ IDEA: StackOverflowError on Build Project

If you are getting the issue in Run/Debug configuration, you can change the same in Run->Edit Configurations->VM parameters: -Xms512M -Xmx1024M -Xss4M -XX:+CMSClassUnloadingEnabled

enter image description here


I also met the same problem. I finally fixed it following thes steps:

In IDEA:

  1. File → settings → Build,Execution,Deployment → Build Tools → Maven → Runner VM Options: add -Xss4096k

  2. File → settings → Build,Execution,Deployment → Compiler Shared build process VM options: add -Xss4m


Adding -Xss4m to the build process VM options should help:

vm options