Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting a OutOfMemory error when attempting to update my Intellij

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.

like image 856
Kaspar Avatar asked Apr 14 '15 18:04

Kaspar


People also ask

How do you fix Outofmemory errors?

1) An easy way to solve OutOfMemoryError in java is to increase the maximum heap size by using JVM options "-Xmx512M", this will immediately solve your OutOfMemoryError.

What is Outofmemory error?

OutOfMemoryError exception. Usually, this error is thrown when there is insufficient space to allocate an object in the Java heap. In this case, The garbage collector cannot make space available to accommodate a new object, and the heap cannot be expanded further.

What causes Java Lang OutOfMemoryError Java heap space?

OutOfMemoryError is a runtime error in Java which occurs when the Java Virtual Machine (JVM) is unable to allocate an object due to insufficient space in the Java heap. The Java Garbage Collector (GC) cannot free up the space required for a new object, which causes a java. lang. OutOfMemoryError .

How do I fix Java Lang OutOfMemoryError Metaspace?

OutOfMemoryError: Metaspace error is thrown. To mitigate the issue, you can increase the size of the Metaspace by adding the -XX:MaxMetaspaceSize flag to startup parameters of your Java application. For example, to set the Metaspace region size to 128M, you would add the following parameter: -XX:MaxMetaspaceSize=128m .


1 Answers

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.

like image 173
brianhks Avatar answered Sep 22 '22 12:09

brianhks