Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Sunday, May 1, 2016

Android Studio is too slow

Android Studio is too slow


I recently upgraded from Eclipse to Android Studio and I'm not really liking the experience. I'm comparing them both on a Windows 7 64 bit ultimate with 16GB of ram and Intel i7 4770 running NVidia Geforce 780 with the latest NVidia drivers if it matters and I'm running the latest JDK and the latest Android Studio.

The Android Studio is very slow in building the project which I can live with but it's also extremely resource intensive and sometimes slows down the PC to a crawl.

Whenever I'm building or running anything in AS, my PC seems to become extremely sluggish. It also causes flickering of screen and occasionally blanking my second monitor if I click on "Gradle build running" spinner which I find very odd. The RAM usage also shoots up to ~3GB which I find excessive for doing nothing (this is when it's idle after a few builds).

In addition, the panels at the bottom of AS keep jumping around which is a horrible user experience (moves from Android to Messages to Version Control or anything else on an ad-hoc basis depending on what's happening which is very, very annoying).

What I would like to know is basically:

1) How do I make Android Studio run better? I may be doing something wrong or missing some updates that I'm not aware of and I'm sure others have also noticed these behaviors and have found some solutions to it.

2) How do I "pin" the bottom panels so that they don't jump around and instead, let me, the user, navigate to them when I wish to instead of automatically switching them?

Many thanks and my apologies again if it's not the correct place for these questions.

Edit 1 Some more comments:

  • I'm using the latest stable build as of today. The build is Android Studio 1.2.2 Build # AI-141.1980579, Build on June 3, 2015
  • The behavior happens when using either Java 7 or 8. It doesn't appear to be related to the version of Java.
  • I am not using Presentation Mode. Just the vanilla view.
  • Doing the changes to the build configuration (thanks to @Blackbelt and his answer) appears to have helped with the build but the other problems with sluggishness and general user experience remain.

Answer by Blackbelt for Android Studio is too slow


Check the AndroidStudio's settings, under compile that the checkbox

Compile independent modules in parallel is enabled.

Under Vmoptions I have

-Xmx2048m -XX:MaxPermSize=1024  

I have an old dual core with 4GB ram, running ubuntu. Qs commandline option I have only --offline , which specifies that the build should operate without accessing network resources. I enabled also the remaining checkboxes:

  1. Make project automatically
  2. Use in-process building
  3. Configure on demand

    and it is running ok

Edit

It is possible to provide additional options through studio.vmoptions, whose location is

  • Windows:

    %USERPROFILE%.{FOLDER_NAME}\studio.exe.vmoptions and/or %USERPROFILE%.{FOLDER_NAME}\studio64.exe.vmoptions

  • Mac

    ~/Library/Preferences/{FOLDER_NAME}/studio.vmoptions

  • Linux

    ~/.{FOLDER_NAME}/studio.vmoptions and/or ~/.{FOLDER_NAME}/studio64.vmoptions

where FOLDER_NAME refers to the version of AndroidStudio you are using. E.g. For AndroidStudio 1.3.x is AndroidStudio1.3.

Increasing the value of -Xmx should help a lot. E.g

-Xms1024m  -Xmx4096m  -XX:MaxPermSize=1024m  -XX:ReservedCodeCacheSize=256m  -XX:+UseCompressedOops  

will assign 4G as max heap, with initial value of 1G

Answer by Sajan Rana for Android Studio is too slow


Tips to make android studio fast:

Enable Offline Work:

  1. Click File -> Settings. Search for "gradle" and click in Offline work box.
  2. Go to Compiler (in same settings dialog just below Gradle) and add --offline to Command-line Options text box.

Improve Gradle Performance

Add following two line of code in your gradle.properties file.

org.gradle.daemon=true  org.gradle.parallel=true  

For More: http://www.viralandroid.com/2015/08/how-to-make-android-studio-fast.html

Answer by jonagon for Android Studio is too slow


It's not compiling that's hurting me here, it's the typing. I could disable all the smart features and be back to notepad++ like TomTsagk suggested in a comment. For today I need more cores and RAM.

Playing devil's advocate I'd argue that typing shouldn't require a 16Gb PC octacore PC. Liked Sajan Rana's advice but things are so slow here it felt mostly a placebo.

To be fair I am using 1.4RC1, which is just short of being in the stable branch. Turning the internet off helped a little. The new feature of simultaneous Design (Preview) and Text views working with XML layouts is very helpful.

No, it is ridiculous. Never leave the stable channel.

Answer by AllDayAmazing for Android Studio is too slow


Just for anyone looking, after upgrading to El Capitan, I noticed a huge lag with the IDE. After increasing a ton of RAM and using the suggestions above, it turned out that I needed to update the legacy Java, and reinstall via: https://support.apple.com/kb/DL1572?locale=en_US

After installing this, all lag was gone.

Answer by Naruto for Android Studio is too slow


Even i do have core i5 machine and 4GB RAM, i do face the same issue. On clean and rebuild the project gradle build system downloads the files jar/lib fresh files from internet. You need to disable this option available in settings of your Android studio. This will re-use the cached lib/jar files. Also the speed of Android studio depends on speed of your hard disk also. Here is detailed post http://www.feelzdroid.com/2015/10/android-studio-gradle-build-speed-very-slow.html on how to improve too slow Android studio.

Answer by Tim for Android Studio is too slow


Please add in setting.gradle (root folder)

startParameter.offline=true  

Answer by Sami for Android Studio is too slow


Okay. I will agree that every answer written above will somehow help the cause. I am one of those who is on the same boat. With nothing working my way, and Android Studio refusing to build on the Offline mode due to the associated dependencies, I did something that eased my problem within minutes.

Every time I build the gradle, I turn off my internet. ( Notice that the Offline mode is not checked). I don't know how and why but this works.

Answer by Werner Schffer for Android Studio is too slow


I detected another reason for very bad performance:

Thumbs.db

I had some folders in res with Thumbs.db files automatically created by Windows.

After putting "Thumbs.db" into the input field "Ignore files and folders" at the bottom of "File -> Settings ... -> Editor -> File Types" Android Studio runs like a charm.

Answer by sayeed for Android Studio is too slow


Well, one thing that worked for me is using physical android device instead of emulator. As in my PC( i5 and 4GB RAM ) the android studio takes about 700MB of memory and the emulator takes another 700. Thus the whole performance of the computer goes down. Working with a physical device saves the strain from the emulator.

Answer by Reza Hamzehie for Android Studio is too slow


I had the same problem.

I found Android Studio to be very slow on simple apps. So how can I expect it to work on big projects?!

I had the same problem on 01/2/2016, using the latest version of Android Studio which was 1.5.

My system had:

  1. Core i7 cpu.

  2. 12G memory.

  3. 4G graphic AMD graphics radeon r5 m230

And also I was using the latest versions of all JDK, SDK etc. For me the Android Studio was consuming a lot of resources and making my computer unusable! So what I did was a clean deletion of Android Studio and installing ECLIPSE! Trust me now my PC is working with a speed of Lamborghini! I hope google fixes its speed. It's a GOOD IDE but it uses too many resources so its slow.

Answer by Reza Hamzehie for Android Studio is too slow


I found another way! In every project you are creating, there is a file called build.gradle (projects: your project); Open this file and change the both jcenter to mavenCentral. This worked for me!


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.