我在 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
来自哪里?我需要删除它。
原文由 woodings 发布,翻译遵循 CC BY-SA 4.0 许可协议
当前版本:
Help
|Change Memory Settings
:从 IntelliJ IDEA 15.0.4 开始,您还可以使用:
Help
|Edit Custom VM Options...
:这将自动在 config 文件夹中创建
.vmoptions
文件的副本,并打开一个对话框进行编辑。旧版本:
IntelliJ IDEA 12 是一个已签名的应用程序,因此不再建议更改
Info.plist
中的选项,因为签名将不匹配,并且您会遇到问题,具体取决于您的系统安全设置(应用程序将无法运行,或防火墙每次启动都会报错,否则应用将无法使用系统密钥库来保存密码)。作为解决 IDEA-94050 的结果,IDEA 12 中引入了一种提供 JVM 选项的新方法:
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.最终文件应如下所示:
复制原始文件很重要,因为选项 不是添加 的,而是 被替换 的。
这样您的自定义选项将在更新之间保留,应用程序文件将保持不变,使签名检查器满意。
社区版:
~/Library/Preferences/IdeaIC12/idea.vmoptions
使用文件代替。