Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
176 views
in Technique[技术] by (71.8m points)

macos - How to speed up Android Studio on a Mac

I am trying to develop some native Android apps using Android Studio (latest) on OS X Yosemite. Currently Android Studio is simply unusable: it is too slow. I am not referring to the Android emulator, which was doubling the development time, but to the source code editor itself.

The main problem is that very often but not always (I would say almost always) it is not able to keep the pace of my editing: when I edit text, characters appear on the screen between one and two seconds later. If I delete characters, I never know which one I reached without waiting for a couple of seconds. If I right-click I wait for the equivalent of geological ages before something is displayed. It is almost impossible to use the graphical layout editor because it is sloooow.

I have also other problems, related to incredible bugs. But I want to focus on this basic functionality.

After a bit of research I ended up increasing its heap space. So I went into:

/Applications/Android Studio.app/Contents/bin

and modified these values in studio.vmoptions:

-Xms512m
-Xmx6000m
-XX:MaxPermSize=1000m
-XX:ReservedCodeCacheSize=500m
-XX:+UseCompressedOops

Actually I have only increased the allocated memory for the first two of them.

Is there anyone developing for Android on a Mac who was able to increase this basic performance of Android Studio? Is there any hidden trick, combination of JVM and options able to make this app usable?

I am working on a MBP 2.3GHz i7 with 16GB of RAM: is it enough?

question from:https://stackoverflow.com/questions/28784387/how-to-speed-up-android-studio-on-a-mac

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I did the following to resolve the Android Studio slowness.

Go to Android -> Preferences -> Build, Execution, Deployment -> Compiler

Check the Option -

Compile independent modules in parallel (may require larger heap size)

Set VM Options to :

-Xmx2048m -XX:MaxPermSize=512

Restart Android Studio.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...