如何在Mac上增加IntelliJ IDEA的IDE内存限制?

362

我在Mountain Lion上使用 IDEA 12 Leda。我想增加IDE可用的最大内存。我在Info.plist文件中设置了VMOptions,如下所示:

-Xmx2048m -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:../lib/boot.jar

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

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

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” 是从哪里来的?我需要将其删除。


4
请注意,对于64位系统,文件名需要为idea64.vmoptions。 - Ittai
@Ittai,对我来说,idea.vmoptions 在 Mac OS 10.9 上也适用于 64 位。 - Koray Tugay
在OS X 10.10.3上使用IntelliJ 14时,我不得不将~/Library/Preferences/IdeaIC14/idea.vmoptions重命名为idea64.vmoptions,以便它能够识别改变,即-Xmx2048m - user711807
在 OS X 10.11 Intellij 15 64 位上,我不得不将 idea64.vmoptions 重命名为 idea.vmoptions 才能使其工作。 - himanshu shekhar
请参阅 http://tomaszdziurko.com/2015/11/1-and-the-only-one-to-customize-intellij-idea-memory-settings 中的IDEA选项调查。 - Grigory Kislin
13个回答

2

看起来 IDEA 已经为你解决了这个问题(就像其他所有问题一样)。当加载大型项目并让它运行时,它会打开一个对话框以提升内存设置。输入 Xmx 的值为 2048 并点击“关闭”,然后重新启动 IDEA,这样 IDEA 就会使用更多的内存启动。尽管在 Windows 上似乎从未持续过(不确定 IDEA 12),但在 Mac OS 上效果很好。


2

0

我使用Mac和Idea 14.1.7。在这里找到idea.vmoptions文件:/Applications/IntelliJ IDEA 14.app/Contents/bin

详情


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接