How to increase the maximum heap size for Android Studio on MAC

To change the maximum heap size you have to edit the studio.vmoptions file.
Go to Applications, find Android Studio.app. Then right click to Show Package Contents.

Android Studio.app on MAC
You will find studio.vmoptions file inside the bin folder.

How to increase the maximum heap size for Android Studio on MAC


By default, Android Studio has a maximum heap size of 1280MB. If you are working on a large project, or your system has a lot of RAM, you can improve performance by increasing the maximum heap size in the VM options for Android Studio. You can set that to Xmx4g or Xmx4096m for 4GB of RAM.

-Xms256m
-Xmx4096m
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-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
-Xverify:none

-XX:ErrorFile=$USER_HOME/java_error_in_studio_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_studio.hprof

No comments:

Post a Comment

NO JUNK, Please try to keep this clean and related to the topic at hand.
Comments are for users to ask questions, collaborate or improve on existing.