Questioner
Questioner

Reputation: 2541

Android Studio is incredibly slow and laggy

Android Studio is painfully slow. It's not just the Gradle build times (which I have seen reach 40+ minutes before I cancelled), it's the whole IDE and my whole computer slows down when AS is open. When I click anywhere in AS, whether it's inside the code or menu items or anything else, it takes seconds to respond.

I uninstalled Eclipse because it was too buggy. AS isn't as buggy but it's way too slow.

Here is what I have tried so far:

  1. Made sure I'm not in presentation mode
  2. Tried both having Compile independent modules in parallel ticked and unticked - slow on both
  3. Changed vmoptions to have -Xmx2048m -XX:MaxPermSize=1024
  4. Ticked Make project automatically
  5. Ticked Use in-process building
  6. Ticked Configure on demand
  7. Ticked Offline work in Gradle
  8. Added --offline in Command-line Options
  9. Added Thumbs.db in "Ignore files and folders" (Editor -> File Types)
  10. Added org.gradle.jvmargs=-Xmx2048m, org.gradle.daemon=true and org.gradle.parallel=true to gradle.properties
  11. Made sure I'm adding only the google play services libraries that I need

None of these solutions helped so how do I fix this? Please don't link a post if it just has things I've tried above.

Upvotes: 16

Views: 18548

Answers (5)

omid karami
omid karami

Reputation: 1

i tried to change my boot runtime version for IDE to 17.0.6 with JCEF. and that caused the slow running problem for my IDE. i fix it, with changing it to Default Runtime. it took a while, but it's fast again now.

Upvotes: 0

programmer master
programmer master

Reputation: 55

I have a few things for you to try out:

  1. Try an older version of android studio.(If the only thing you want is performance).
  2. Try using a physical device instead of a virtual machine.
  3. Try using a lighter operating system (like lubuntu 18.04). Windows on my computer takes 1 gb when idle while lubuntu takes 1.2 gb when android studio is running
  4. If none of the above work you should consider upgrading your computer. I personally use a core 2 duo E8400(2 cores,2.83 ghz) with Lubuntu 18.04 and 2 gb ram and android studio 2.3.2 (my computer is so old that is why :)) and it runs flawlessly but you have a core i3 and 4 gb ram which can run higher versions. NOTE: If you are using Kotlin DO NOT use android studio 2! it does not have support for Kotlin if you use java or c++ go ahead (although you may give up some features.).

Upvotes: 0

Ali Nem
Ali Nem

Reputation: 5570

Did you also check -Xms2048m in vmOptions?

This affects the initial ram your android studio takes from the system when loading. The other setting you have (-Xmx2048m) affects the maximum ram android studio can get.

Also setting (-XX:ReservedCodeCacheSize=1024m) helps.

Upvotes: 1

gal
gal

Reputation: 441

Like karun already said, an i3 is definitely too low powered to run Android Studio. I'd recommend at least an i7 2ghz or faster, paired with a pure ssd storage (spinning disks are horribly slow in comparison). 8gb RAM is the absolute minimum, 16gb or even more would be better. Android Studio is a heavy-wight IDE and it uses a lot of memory, especially when running gradle in parallel mode.

With such a setup, it still doesn't feel what I would call "fast", but it's OK, regarding all the tasks going on at the same time.

If you want to keep the i3, then the best you can do is to equip it with as much RAM as possible. Also replace your disc (if it's a spinning one) by a fast ssd drive.

Upvotes: 3

Karun Shrestha
Karun Shrestha

Reputation: 733

This is not a solution, but i think i3 processors are not much powerful to run Android studio smoothly. I had i5 processor and 4GB ram, and I couldn't run chrome and android studio simultaneously with ease but now I've upgraded my ram to 8GB, which helps a lot, still the laptop freezes a bit when the gradle files are being built but other times every thing runs smoothly.

Upvotes: 2

Related Questions