如何为Intellij编译器提供更多堆空间? [英] How can I give the Intellij compiler more heap space?

查看:230
本文介绍了如何为Intellij编译器提供更多堆空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建一个Intellij项目时,我不断收到以下内存不足错误。

When I make an Intellij project, I keep getting the following out of memory error.

我已经在想法中增加了我的堆大小。 vmoptions

-Xms128m
-Xmx2048m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=64m
-ea

但我仍然得到此错误:

Information:The system is out of resources.
Information:Consult the following stack trace for details.
Information:java.lang.OutOfMemoryError: Java heap space
Information:    at com.sun.tools.javac.util.Position$LineMapImpl.build(Position.java:139)
Information:    at com.sun.tools.javac.util.Position.makeLineMap(Position.java:63)
Information:    at com.sun.tools.javac.parser.Scanner.getLineMap(Scanner.java:1105)
Information:    at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:512)
Information:    at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:550)
Information:    at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:804)
Information:    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
Information:    at com.sun.tools.javac.main.Main.compile(Main.java:353)
Information:    at com.sun.tools.javac.main.Main.compile(Main.java:279)
Information:    at com.sun.tools.javac.main.Main.compile(Main.java:270)
Information:    at com.sun.tools.javac.Main.compile(Main.java:69)
Information:    at com.sun.tools.javac.Main.main(Main.java:54)
Information:    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Information:    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Information:    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Information:    at java.lang.reflect.Method.invoke(Method.java:597)
Information:    at com.intellij.rt.compiler.JavacRunner.main(JavacRunner.java:71)
Information:Compilation completed with 1 error and 0 warnings
Information:1 error
Information:0 warnings
Error:Compiler internal error. Process terminated with exit code 3

我缺少什么?

推荐答案

当前版本:

设置首选项在Mac上)| 构建,执行,部署 | 编译器 |
构建流程堆大小

Settings (Preferences on Mac) | Build, Execution, Deployment | Compiler | Build process heap size.

旧版本:

设置(Mac上的偏好设置)| 编译器 | Java编译器 | 最大堆大小

Settings (Preferences on Mac) | Compiler | Java Compiler | Maximum heap size.

默认情况下,编译器在单独的JVM中运行,因此您在中设置了IDEA堆设置。 vmoptions 对编译器没有影响。

Compiler runs in a separate JVM by default so IDEA heap settings that you set in idea.vmoptions have no effect on the compiler.

这篇关于如何为Intellij编译器提供更多堆空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆