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

本文翻译自:How to increase IDE memory limit in IntelliJ IDEA on Mac?

I'm using IDEA 12 Leda on Mountain Lion. 我在Mountain Lion上使用IDEA 12 Leda。 I wanted to increase the maximum memory that IDE can use. 我想增加IDE可以使用的最大内存。 I set the VMOptions in Info.plist file to be -Xmx2048m -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:../lib/boot.jar 我在Info.plist文件中将VMOptions设置为-Xmx2048m -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:../lib/boot.jar

When I open up IDEA, I still see the maximum memory to be 711m. 当我打开IDEA时,我仍然看到最大内存为711m。

jps -v shows my VMOptions has been loaded but it's replaced by the following options. 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

Where does -Xmx800 come from? -Xmx800来自哪里? I need to remove it. 我需要将其删除。


#1楼

参考:https://stackoom.com/question/uyH0/如何在Mac上的IntelliJ-IDEA中增加IDE内存限制


#2楼

Since IDEA 15.0.4 you can use Help | 从IDEA 15.0.4开始,您可以使用“ Help |“ Help Edit Custom VM Options... : Edit Custom VM Options...

编辑自定义VM选项

This will automatically create a copy of the .vmoptions file in the config folder and open a dialog to edit it. 这将在config文件夹中自动创建.vmoptions文件的副本,并打开一个对话框进行编辑。


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). IntelliJ IDEA 12是已签名的应用程序,因此不再建议更改Info.plist选项,因为签名将不匹配,并且您将根据系统安全设置而遇到问题(应用程序将无法运行,或者防火墙会在每个启动,否则该应用将无法使用系统密钥库保存密码)。

As a result of addressing IDEA-94050 a new way to supply JVM options was introduced in IDEA 12: 由于解决了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 . 现在,它可以采取VM选项从~/Library/Preferences/<appFolder>/idea.vmoptions从和系统属性~/Library/Preferences/<appFolder>/idea.properties

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. 例如,要使用-Xmx2048m选项,应将/Applications/IntelliJ IDEA.app/bin/idea.vmoptions的原始.vmoptions文件复制到~/Library/Preferences/IntelliJIdea12/idea.vmoptions ,然后修改-Xmx设置。

The final file should look like: 最终文件应如下所示:

-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 . 复制原始文件很重要,因为没有添加选项, 而是将替换

This way your custom options will be preserved between updates and application files will remain unmodified making signature checker happy. 这样,您的自定义选项将在更新之间保留,而应用程序文件将保持不变,从而使签名检查器满意。


Community Edition : ~/Library/Preferences/IdeaIC12/idea.vmoptions file is used instead. Community Edition :改为使用~/Library/Preferences/IdeaIC12/idea.vmoptions文件。


#3楼

在我的机器上,这仅适用于bin/idea.vmoptions ,在~/Library/Preferences/IntelliJIdea12/idea.vmoptions添加设置会导致IDEA在启动过程中挂起。


#4楼

It looks like IDEA solves this for you (like everything else). 看起来IDEA可以为您解决这个问题(就像其他所有事情一样)。 When loading a large project and letting it thrash, it will open a dialog to up the memory settings. 加载大型项目并使其崩溃时,它将打开一个对话框以调出内存设置。 Entering 2048 for Xmx and clicking "Shutdown", then restarting IDEA makes IDEA start up with more memory. 为Xmx输入2048并单击“关闭”,然后重新启动IDEA将使IDEA启动时具有更多的内存。 This seems to work well for Mac OS, though it never seems to persist for me on Windows (not sure about IDEA 12). 对于Mac OS来说,这似乎工作得很好,尽管对于Windows而言,它似乎永远也不会持久(不确定IDEA 12)。


#5楼

这是到今天为止最新文档的链接http://www.jetbrains.com/idea/webhelp/increasing-memory-heap.html


#6楼

go to that path "C:\\Program Files (x86)\\JetBrains\\IntelliJ IDEA 12.1.4\\bin\\idea.exe.vmoptions" and change size to -Xmx512m 转到该路径“ C:\\ Program Files(x86)\\ JetBrains \\ IntelliJ IDEA 12.1.4 \\ bin \\ idea.exe.vmoptions”,并将大小更改为-Xmx512m

  -Xms128m
  -Xmx512m
  -XX:MaxPermSize=250m
  -XX:ReservedCodeCacheSize=64m
  -XX:+UseCodeCacheFlushing
  -ea
  -Dsun.io.useCanonCaches=false
  -Djava.net.preferIPv4Stack=true

hope its will work 希望它会工作

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值