3

Full error:

MaxJavaStackTraceDepth=-1 is outside allowed range [0 .... 1073741823],
improperly specified vm option 'MaxJavaStackTraceDepth=-1'

failed to create JVM. JVM path: C:\Program Files\Android\Android Studio\jre\jre

Last thing I did to break it:

Under Help → Edit Custom VM Options:

-Xms1024m 
-Xmx3072m # <------ increase this to most of your RAM 
-XX:MaxPermSize=1024m 
-XX:ReservedCodeCacheSize=440m 
-XX:+UseCompressedOops 
-XX:-HeapDumpOnOutOfMemoryError 
-Dfile.encoding=UTF-8

I have tried:

  • Reinstalling Android studio
  • Deleting vm options.
-server
-Xms750m
-Xmx750m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djna.nosys=true
-Djna.boot.library.path=
-da
double-beep
  • 5,031
  • 17
  • 33
  • 41
Added Lee
  • 41
  • 1
  • 3
  • 1
    Can you post a little more to the problem you are having? E.g. what you're doing to cause the problem, what errors you get when you try to start. – Druckles May 27 '19 at 08:14
  • What Java version are you using? This may happen if you're running on Java 5 or below: https://stackoverflow.com/questions/11865307/how-to-expand-size-of-java-stack-trace-to-see-bottom-of-stack-triggering-a-sta#11872297. You could also try explicitly setting the JVM option to 0 to see how it reacts. – Druckles May 27 '19 at 11:11
  • 1
    @i just deleted the vm options in the config files and it fixed :S i though the ones casuing the problem were in c:program files – Added Lee May 27 '19 at 11:29

5 Answers5

6

Delete the vm options in the C:\Users\username\.AndroidStudio3.4\config.

Deleting the ones in the C:\Program Files\Android\Android Studio\bin doesn't do anything.

double-beep
  • 5,031
  • 17
  • 33
  • 41
6

Deleting vm options in the C:\Users\username\.AndroidStudio3.4\config\studio64.exe.vmoptions does work.

user7413974
  • 61
  • 1
  • 2
5

This is the path in my case. C:\Users\DELL\.AndroidStudio3.5\config\studio64.exe.vmoptions

It may be different according to your android studio version.

enter image description here

Aman Srivastava
  • 1,007
  • 1
  • 13
  • 25
4

If you're using Windows 10 and Android Studio 4.1, you should delete C:\Users\%USERNAME%\AppData\Roaming\Google\AndroidStudio4.1\studio64.exe.vmoptions.

double-beep
  • 5,031
  • 17
  • 33
  • 41
Ketan Ramteke
  • 10,183
  • 2
  • 21
  • 41
0

Try deleting this file :

C:\Users\{youy_user_name}\AppData\Roaming\Google\AndroidStudioPreview2020.3\studio64.exe.vmoptions