I've been trying to update android studio to 2.1 from 2.0 and have run out of idea's. I'm getting a
java.lang.OutOfMemoryError: Java heap space
error. I've tried goggling to find solutions and have tried ones such as these with no joy:
Here's the full error I'm receiving:
Temp. directory: C:\Users\Aaron\AppData\Local\Temp\
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3236)
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
at com.intellij.updater.Utils.copyStream(Utils.java:165)
at ie.wombat.jbdiff.JBPatch.bspatch(JBPatch.java:83)
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:280)
at com.intellij.updater.Runner.access$000(Runner.java:17)
at com.intellij.updater.Runner$1.execute(Runner.java:246)
at com.intellij.updater.SwingUpdaterUI$5.run(SwingUpdaterUI.java:191)
at java.lang.Thread.run(Thread.java:745)
I've created the .vmoptions file in the correct directory by going to Help > Edit Custom VM Options. The file created was named studio64.exe.vmoptions
in case that's of any interest the contents of this file after I edited the one line is:
# custom Android Studio VM options
#
# *DO NOT* modify this file directly. If there is a value that you would like to override,
# please add it to your user specific configuration file.
#
# See http://tools.android.com/tech-docs/configuration
#
-Xms256m
-Xmx2048m //Edited Line
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-da
-Djna.nosys=true
-Djna.boot.library.path=
-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-Didea.paths.selector=AndroidStudio2.0
-Didea.platform.prefix=AndroidStudio
I had trouble updating from 1.5 to 2.0 before as well and had to do a clean install but that is very tedious for a 18MB patch file.
Finally here's what I think is a range of android related installation folders in what I think is a somewhat random spot. Don't know if that's my doing during the installation or android's:
.
Edit:
This is the notification that I am presented with prior to updating. As you can see it's coming from the stable channel.
.
There is plenty of spare memory available just in case I needed to point that out.
Cheer's for any help.