当项目比较大时,build项目需要占用大量内存,有时候会报错java.lang.OutOfMemoryError,这种情况下修改下idea的设置即可。
File -> Settings -> Build,Execution,Deployment -> Compiler,将 Build process heap size 的默认值700修改为2048(根据自己项目需要调整),然后重启idea即可生效。