如何在Mac上的IntelliJ IDEA中增加IDE内存限制? [英] How to increase IDE memory limit in IntelliJ IDEA on Mac?

查看:3454
本文介绍了如何在Mac上的IntelliJ IDEA中增加IDE内存限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mountain Lion上使用IDEA 12 Leda。我想增加IDE可以使用的最大内存。我将Info.plist文件中的VMOptions设置为
-Xmx2048m -ea -XX:+ HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath / a:../ lib / boot.jar

I'm using IDEA 12 Leda on Mountain Lion. I wanted to increase the maximum memory that IDE can use. I set the VMOptions in Info.plist file to be -Xmx2048m -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:../lib/boot.jar

当我打开IDEA时,我仍然看到最大内存为711m。

When I open up IDEA, I still see the maximum memory to be 711m.

jps -v 显示我的VMOptions已加载,但已被以下选项取代。

jps -v shows my VMOptions has been loaded but it's replaced by the following options.

29388  **-Xmx2048m** -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:../lib/boot.jar -Xms128m **-Xmx800m** -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=64m -XX:+UseCodeCacheFlushing -XX:+UseCompressedOops -Didea.paths.selector=IdeaIC12 -Dsun.java2d.noddraw=true -Didea.max.intellisense.filesize=2500 -Didea.dynamic.classpath=false -Didea.jars.nocopy=false -Dsun.java2d.d3d=false -Dapple.awt.fullscreencapturealldisplays=false -Dapple.laf.useScreenMenuBar=true -Djava.endorsed.dirs= -Dswing.bufferPerWindow=false -Didea.fatal.error.notification=enabled -Didea.cycle.buffer.size=1024 -Didea.popup.weight=heavy -Didea.xdebug.key=-Xdebug -Dapple.awt.graphics.UseQuartz=true -Dsun.java2d.pmoffscreen=false -Didea.no.launcher=false -DCVS_PASSFILE=~/.cvspass -Didea.use.default.antialiasing.in.editor=false -Dcom.apple.mrj.application.live-resize=false -Didea.smooth.progress=false
29392 Jps -Dapplication.home=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home -Xms8m

-Xmx800 来自哪里?我需要将其删除。

Where does -Xmx800 come from? I need to remove it.

推荐答案

自IDEA 15.0.4起,您可以使用帮助 | 编辑自定义VM选项...

Since IDEA 15.0.4 you can use Help | Edit Custom VM Options...:

这将自动在config文件夹中创建 .vmoptions 文件的副本,并打开一个对话框进行编辑。

This will automatically create a copy of the .vmoptions file in the config folder and open a dialog to edit it.

IntelliJ IDEA 12是已签名的应用程序,因此不再更改 Info.plist 中的选项建议,因为签名不匹配,您将遇到问题,具体取决于您的系统安全设置(应用程序将无法运行,或防火墙会在每次启动时都会抱怨,或者应用程序将无法使用系统密钥库来保存密码) 。

IntelliJ IDEA 12 is a signed application, therefore changing options in Info.plist is no longer recommended, as the signature will not match and you will get issues depending on your system security settings (app will either not run, or firewall will complain on every start, or the app will not be able to use the system keystore to save passwords).

解决 IDEA-94050 的问题IDEA 12中引入了一种提供JVM选项的新方法:

As a result of addressing IDEA-94050 a new way to supply JVM options was introduced in IDEA 12:


现在可以从
<$ c $获取VM选项C>〜/库/身高从&code>〜/ Library / Preferences /< appFolder> /idea.properties 。

例如,要使用 -Xmx2048m 选项,您应复制原始 .vmoptions 文件从 / Applications / IntelliJ IDEA.app/bin/idea.vmoptions 〜/ Library /首选项/ IntelliJIdea12 / idea.vmoptions ,然后修改 -Xmx 设置。

For example, to use -Xmx2048m option you should copy the original .vmoptions file from /Applications/IntelliJ IDEA.app/bin/idea.vmoptions to ~/Library/Preferences/IntelliJIdea12/idea.vmoptions, then modify the -Xmx setting.

最终文件应如下所示:

-Xms128m
-Xmx2048m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops

复制原始文件很重要,因为选项未添加已替换

Copying the original file is important, as options are not added, they are replaced.

这样,您的自定义选项将在更新之间保留,应用程序文件将保持不变,从而生成签名ch ecker happy。

This way your custom options will be preserved between updates and application files will remain unmodified making signature checker happy.

社区版〜/ Library / Preferences改为使用/IdeaIC12/idea.vmoptions 文件。

这篇关于如何在Mac上的IntelliJ IDEA中增加IDE内存限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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