尝试更新我的Intellij时出现OutOfMemory错误
我正在尝试将IntelliJ IDEA从build 141.177更新为141.178。 当更新下载所需的所有文件,并开始更新时,我收到此错误:
Temp. directory: /tmp java.lang.OutOfMemoryError: Java heap space at ie.wombat.jbdiff.JBPatch.bspatch(JBPatch.java:91) at com.intellij.updater.BaseUpdateAction.applyDiff(BaseUpdateAction.java:112) at com.intellij.updater.UpdateAction.doApply(UpdateAction.java:44) at com.intellij.updater.PatchAction.apply(PatchAction.java:184) at com.intellij.updater.Patch$3.forEach(Patch.java:308) at com.intellij.updater.Patch.forEach(Patch.java:360) at com.intellij.updater.Patch.apply(Patch.java:303) at com.intellij.updater.PatchFileCreator.apply(PatchFileCreator.java:84) at com.intellij.updater.PatchFileCreator.apply(PatchFileCreator.java:75) at com.intellij.updater.Runner.doInstall(Runner.java:295) at com.intellij.updater.Runner.access$000(Runner.java:18) at com.intellij.updater.Runner$2.execute(Runner.java:261) at com.intellij.updater.SwingUpdaterUI$5.run(SwingUpdaterUI.java:191) at java.lang.Thread.run(Thread.java:745)
/tmp
文件夹应该在我的根分区上,其大小为20GiB,目前它仍然剩下大约8GiB。 所以我真的不明白现在的问题是什么。 另外,我不确定RAM部分,我的系统在进行更新时使用了40%的RAM。
阅读JetBrains 文档以及有关如何增加IntelliJ的最大堆大小的答案 。
根据我上面提到的文档,在idea.vmoptions
(32位版本)或idea64.vmoptions
(64位版本)中设置-Xmx2048m
,并将其复制到适当的位置。
我也会做File > Invalidate Caches / Restart > Invalidate and Restart
,只是为了确保所做的更改(可能没有必要,但以防万一)。
当我尝试通过自动更新程序从14.1.1升级到14.1.2时,我今天收到了完全相同的堆栈跟踪。 在OS X上,我通过将~/Library/Preferences/IdeaIC14/idea.vmoptions
重命名为~/Library/Preferences/IdeaIC14/idea.vmoptions
来解决它。 我已经在该文件中设置了-Xmx2048m
,但显然直到我正确地重命名它才被读取。
另请参阅YouTrack问题IDEA-139036 (感谢@Meo)。
我遇到了同样的问题。 问题是idea.vmoptions更改主intellij进程的内存,但不更改更新进程。 在我的情况下,更新过程只分配了500米。
我在错误发生后让更新窗口保持打开状态,从而解决了这个问题。 然后我跑了ps -Af | grep java
ps -Af | grep java
(我正在运行linux)。 这向我展示了更新过程的命令行。 我将其复制出来并将-Xmx500m
更改为-Xmx1024m
。 然后我在另一个控制台中运行修改后的命令行,一旦完成,我退出原始更新窗口,一切都很好。