Unable to upgrade Android 2.0 studio to version 2.1

I am trying to upgrade android studio to version 2.1 from version 2.0 and finished the idea. I get

java.lang.OutOfMemoryError: Java heap space 

error. I tried looking for solutions and tried these without joy:

stack overflow

Tech Docs from Google

Here's the full error I get:

 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 created the .vmoptions file in the correct directory by choosing Help> Edit Custom Virtual Machine Settings. The created file was named studio64.exe.vmoptions if the contents of this file are of any interest after I have edited one line:

 # 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 also had a problem upgrading from 1.5 to 2.0, as well as for a clean install, but it is very tedious for the 18 MB fix file.

Finally, here I think this is a set of android-related installation folders in what I consider somewhat random. I don’t know what I do during installation or Android:

Installation .

Edit:

This is the notice that I present before the upgrade. As you can see, this comes from a stable channel.

Updating .

There is a lot of spare memory if I want to point this out.

Greet any help.

+5
source share
3 answers

I finally solved the problem, just now.

After almost giving up work, I returned to the project I was working on and noticed that I was getting 18 instances of the same error when I was compiling an application that was operational. This error was in the lines _JAVA_OPTIONS_ -Xmx512m , which was strange in this file in the file that I created for setting user VM parameters, this value was set to -Xmx2048m .

This made me think that for some reason this VM parameter was not recognized, possibly due to the studio64.exe.vmoptions file in one of the previous installation folders for Android. I looked into these folders and noticed another file with this name! I uninstalled it again by running the application but still getting the same error.

This is when I then remembered that I created an environment variable more than a year ago, when I was just starting out in Java and the book that I used to help her deal with it, it is recommended to start writing all programs in a text editor with AND to set the environment variables through advanced options in windows. Well, the environment variable was still present and was set to 512 m:

1

(The path for anyone who thinks they have done this is Control Panel » System » Advanced » Environment Variables )

I deleted this environment variable and checked the water before updating - I restarted the application without errors received this time. Stop the application, try updating to 2.1.1 on the 45th and with pleasure for the last time.

Apologies for the fact that the question does not include the missing information, but, as you can probably appreciate, it can easily slip in any case.

+6
source

Based on the stack trace, you just need to configure the VM parameters as shown below.

 -Xms128m -Xmx4096m -XX:MaxPermSize=1024m -XX:ReservedCodeCacheSize=200m -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+HeapDumpOnOutOfMemoryError 

The location you mentioned is the default location for Windows.

You will find Android Studio in these default folders (if you have not configured it) based on the operating system you are using:

on Windows should be in the directory c: \ user \ yourname.AndroidStudio2.0

on Linux should be in /home/yourname/.AndroidStudio2.0

on Mac should be in ~ / Library / Preferences / .AndroidStudio2.0

And what can you do -

a. New version of Android Studio 2.0.

b. make export options from the previous version - (which will create a .jar file for all configurations)

with. Import the settings into a newer version.

+2
source

Delete the .gradle file and then try updating it to version 2.1, it may work

0
source

All Articles