7

I am trying to update IntelliJ IDEA from build 141.177 to 141.178. When the updated downloads all the files needed, and starts the update, I get this error:

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)

The /tmp folder should be on my root partition which has 20GiB of size, and currently it still has about 8GiB left. So I don't really understand what the problem could be here right now. Plus I am not sure about the RAM part, my system is using 40% of my RAM when I do the update.

Kaspar
  • 1,600
  • 4
  • 24
  • 46
  • 3
    https://youtrack.jetbrains.com/issue/IDEA-139036 – Meo Apr 14 '15 at 18:49
  • Seems to be that everyone got it working randomly when trying again... Does not work for me. – Kaspar Apr 14 '15 at 18:54
  • This is a memory error, not a disk space error. There are usually some ways to increase size for the jvm but I am not sure how this works with the updater. Long shot, maybe - What are your JAVA_OPTS set to, if anything? – vikingsteve Apr 14 '15 at 18:58
  • No idea about them, probably not set to anything. – Kaspar Apr 14 '15 at 19:02
  • Try the other update way (downloading the full package) –  Apr 14 '15 at 19:04
  • That will work of course, tried it allready. Was just hoping that maybe the updater would handle it too. It used to but it seems now something is wrong. – Kaspar Apr 14 '15 at 19:06
  • Then provide a heap dump to JetBrains, so they can fix it. – Meo Apr 14 '15 at 19:37

2 Answers2

14

I hit this same problem. The issue is that idea.vmoptions change the memory for the main intellij process but not the update process. In my case the update process only had 500m allocated to it.

I got past the problem by leaving the update window open after it got the error. I then ran ps -Af | grep java (I'm running linux). This showed me the command line for the update process. I copied it out and changed -Xmx500m to -Xmx1024m. I then ran the modified command line in another console, once it was done I exited the original update window and all was good.

brianhks
  • 161
  • 4
  • This worked great for me too (using Linux as well). The key is to leave the error window open and then run the modified command. Thanks! – Minibiti May 18 '15 at 08:20
8

Read the JetBrains documentation & this answer about how to increase the maximum heap size for IntelliJ.

Set -Xmx2048m in idea.vmoptions (32-bit edition) or idea64.vmoptions (64-bit edition), and copy it to the appropriate location, according to the documentation I referred to above.

I would also do File > Invalidate Caches / Restart > Invalidate and Restart, just to be sure that the changes took (probably not necessary, but just in case).

I received the exact same stack trace today while attempting to upgrade from 14.1.1 to 14.1.2 via the automatic updater. On OS X, I solved it by renaming ~/Library/Preferences/IdeaIC14/idea.vmoptions to idea64.vmoptions. I already had -Xmx2048m set in that file, but apparently it wasn't being read until I renamed it correctly.

Also see YouTrack issue IDEA-139036 (thanks to @Meo).

Community
  • 1
  • 1