Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 691
Questioner Avatar asked Jun 08 '16 13:06

Questioner


People also ask

Why does Android Studio take so long?

If Android Studio has a proxy server setting and can't reach the server then it takes a long time to build, probably its trying to reach the proxy server and waiting for a timeout. When I removed the proxy server setting its working fine.

Is Android Studio heavy?

In the previous versions, the android studio was more heavy software Google is updating it and making it more scalable for developers. But it is even also heavy software which will suck your computer's ram.

Can we use Android Studio in 4GB RAM?

According to developers.android.com, minimum requirement for android studio is: 4 GB RAM minimum, 8 GB RAM recommended. 2 GB of available disk space minimum, 4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image)


2 Answers

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.

like image 77
gal Avatar answered Oct 20 '22 14:10

gal


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.

like image 45
Karun Shrestha Avatar answered Oct 20 '22 16:10

Karun Shrestha