I wrongly increased the heap size of my android studio, and when i start android studio , i am getting this error
Invalid maximum heap size: -Xmx4096m # <------ increase this to most of your RAM
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.I know this is something related to Java heap memory, i have reinstalled the Android studio, but getting the same error.
Please tell me where can i change the heap size of Java ?? i am using ubuntu18
31 Answer
The start script <install-path>/android-studio/bin/studio.sh does consult the files as follows to read configurations.
For 64bit systems:
<install-path>/android-studio/bin/studio64.vmoptions
${HOME}/.AndroidStudio<version>/config/studio64.vmoptions
<install-path>/android-studio.vmoptionsFor 32bit systems:
<install-path>/android-studio/bin/studio.vmoptions
${HOME}/.AndroidStudio<version>/config/studio.vmoptions
<install-path>/android-studio.vmoptionsDepending on your architecture 32bit vs 64bit and how you did change the heap size setting, you can look through the files mentioned above and alter the Xmx with a text editor of your choice.