intelliJ IDEA maven打包时提示系统资源不足

idea中 maven编译waimai_risk项目代码,提示系统资源不足,错误信息如下:

[INFO] Changes detected - recompiling the module!
 
[INFO] Compiling 424 source files to /Users/liulong/workspace/waimai_risk/target/classes
 
系统资源不足。
 
有关详细信息, 请参阅以下堆栈跟踪。
 
java.lang.OutOfMemoryError: Java heap space
 
    at com.sun.tools.javac.util.SharedNameTable.fromChars(SharedNameTable.java:99)
 
    at com.sun.tools.javac.util.Name$Table.fromString(Name.java:204)
 
    at com.sun.tools.javac.util.Names.fromString(Names.java:288)
 
    at com.sun.tools.javac.jvm.ClassReader.includeClassFile(ClassReader.java:2377)
 
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2528)
 
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2446)
 
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2143)
 
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:421)
 
    at com.sun.tools.javac.jvm.ClassReader.completeOwners(ClassReader.java:2155)
 
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2134)
 
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:421)
 
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:821)
 
    at com.sun.tools.javac.code.Symbol$ClassSymbol.members(Symbol.java:769)
 
    at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.findAccessMethod(ClassReader.java:1531)
 
    at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:1521)
 
    at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompoundList(ClassReader.java:1510)
 
    at com.sun.tools.javac.jvm.ClassReader$AnnotationCompleter.enterAnnotation(ClassReader.java:1700)
 
    at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:109)
 
    at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:101)
 
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:510)
 
    at com.sun.tools.javac.comp.Enter.main(Enter.java:469)
 
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:929)
 
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
 
    at com.sun.tools.javac.main.Main.compile(Main.java:439)
 
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
 
    at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:125)
 
    at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169)
 
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:825)
 
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
 
[INFO] -------------------------------------------------------------
 
[ERROR] COMPILATION ERROR :
 
[INFO] -------------------------------------------------------------
 
[ERROR] An unknown compilation problem occurred
 
[INFO] 1 error
 
[INFO] -------------------------------------------------------------
 
[INFO] ------------------------------------------------------------------------
 
[INFO] BUILD FAILURE
 
[INFO] ------------------------------------------------------------------------
 
[INFO] Total time: 03:40 min
 
[INFO] Finished at: 2017-12-06T11:45:45+08:00
 
[INFO] Final Memory: 77M/121M
 
[INFO] ------------------------------------------------------------------------
 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project waimai_risk: Compilation failure
 
[ERROR] An unknown compilation problem occurred
 
[ERROR]
 
[ERROR] -> [Help 1]
 
[ERROR]
 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
 
[ERROR]
 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
 
➜  waimai_risk git:(master)


具体操作如下:waimai_risk-Run Configurations-waimai_risk[install]-右键-选择 edit run confguration,如下

添加jvm参数

重新编译,成功。

你可能感兴趣的:(jvm性能调优)