我在 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
从何而来?我需要删除它。
最佳答案
当前版本:Help
| Change Memory Settings
:
从 IntelliJ IDEA 15.0.4 开始,您还可以使用:Help
| Edit Custom VM Options...
:
这将自动创建 .vmoptions
的副本配置文件夹中的文件并打开一个对话框进行编辑。
旧版本:
IntelliJ IDEA 12 是一个签名的应用程序,因此更改 Info.plist
中的选项不再推荐,因为签名将不匹配,并且您会遇到问题,具体取决于您的系统安全设置(应用程序将无法运行,或者防火墙会在每次启动时提示,或者应用程序将无法使用系统 keystore 保存密码)。
作为寻址 IDEA-94050 的结果IDEA 12 中引入了一种提供 JVM 选项的新方法:
Now it can take VM options from
~/Library/Preferences/<appFolder>/idea.vmoptions
and system properties from~/Library/Preferences/<appFolder>/idea.properties
.
例如,要使用 -Xmx2048m 选项,您应该复制原始 .vmoptions
来自 /Applications/IntelliJ IDEA.app/bin/idea.vmoptions
的文件至~/Library/Preferences/IntelliJIdea12/idea.vmoptions
,然后修改-Xmx
设置。
最终文件应如下所示:
-Xms128m
-Xmx2048m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
复制原始文件很重要,因为选项未添加,它们被替换。
这样,您的自定义选项将在更新之间保留,应用程序文件将保持不变,使签名检查器满意。
社区版:~/Library/Preferences/IdeaIC12/idea.vmoptions
文件改为使用。
https://stackoverflow.com/questions/13578062/