简体   繁体   English

intellij中应在哪里配置最大堆大小?

[英]Where should maximum heap size be configured in intellij?

Under Preferences -> Compiler -> Java Compiler I notice that Additional Command line properties and maximum heap size can be configured. Preferences -> Compiler -> Java Compiler我注意到可以配置其他命令行属性和最大堆大小。

在此处输入图片说明

For these to take effect, I restart IntelliJ. 为了使这些生效,我重新启动IntelliJ。 However, I still keep getting Out of memory error on one of my programs. 但是,我仍然在我的程序之一上Out of memory error

I also noticed the idea.vmoptions file where the settings still are: 我还注意到idea.vmoptions文件的设置仍然是:

~/Documents $ more /Applications/IntelliJ\ IDEA\ 12.app/bin/idea.vmoptions 
-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops

Question

I want to use UseConcMarkSweepGC and raise max heap size to 4gb. 我想使用UseConcMarkSweepGC并将最大堆大小提高到4gb。 Where should I be doing this for it to take effect in IntelliJ? 我应该在哪里做才能使其在IntelliJ中生效? I am using Intellij12 我正在使用Intellij12

Just open file idea.vmoptions with TextEdit and change config as you like :) 只需使用TextEdit打开文件idea.vmoptions并根据需要更改配置即可:)

-Xms128m
-Xmx4G  // change this 
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
-XX:+UseConcMarkSweepGC // and add this

Compiler options - it's options for execute javac. 编译器选项-执行Javac的选项。

But one question: Why you want so huge heap for Idea? 但是有一个问题:为什么要给Idea这么大的堆?

If you have OOM when you run project, try change Run options (not compiler and not IDE). 如果在运行项目时拥有OOM,请尝试更改“运行”选项(不是编译器,也不是IDE)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM