Android Studio Slow and Using Too Much RAM
Quick answer
Android Studio's default heap is 1280 MB, so large projects can lag or run out of memory. Raise the IDE and Gradle heap sizes if you have RAM to spare, or trim the load on small machines.
Most likely fix: Increase the IDE heap
How to fix it
Try these in order — the most common fix is first.
1. Increase the IDE heap
- File > Settings > Appearance & Behavior > System Settings > Memory Settings (Android Studio > Settings on macOS)
- Raise IDE heap, and the Gradle and Kotlin daemon heaps if you have RAM to spare
- Apply and restart; Google warns that allocating too much can also hurt performance
Did this fix it?2. Edit VM options manually
- Help > Edit Custom VM Options
- Add for example -Xmx4g, save and restart
Did this fix it?3. Exclude folders from antivirus (Windows)
- Exclude %USERPROFILE%\.gradle, %USERPROFILE%\AndroidStudioProjects and the Android SDK folder from real-time scanning
- Do not disable the antivirus entirely
Did this fix it?4. Tune for low-memory machines
- File > Power Save Mode turns off background inspections and auto-compile
- Reduce org.gradle.jvmargs in gradle.properties
- Uncheck Settings > Build, Execution, Deployment > Compiler > Compile independent modules in parallel
- Run on a physical device instead of the emulator
Did this fix it?5. Stop extra daemons
- Use the same Gradle version and JDK across projects so daemons are reused
- Close unused projects; run ./gradlew --stop to kill idle daemons
Did this fix it?
Symptoms
Typing lags, indexing runs for minutes, the memory indicator is almost full, or the whole computer slows down.
Why it happens
- IDE max heap too small for the project (default 1280 MB)
- Several Gradle and Kotlin daemons running at once
- Large projects and heavy indexing
- Emulator running at the same time on a low-RAM machine
- Antivirus real-time scanning of project and Gradle folders
This guide also covers
- android studio high ram usage
- why is android studio so slow
- android studio memory usage
- android studio lagging
Still not working?
If Android Studio keeps failing, you're not alone. See every Android Studio problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
All slow, laggy or resource-hungry guides →
- IntelliJ IDEA High Memory Usage (JetBrains IntelliJ)
- Cursor Slow, High CPU or Memory Usage (Cursor)
Other Android Studio errors
- Android Studio Gradle Sync Failed
- Android Studio Emulator Not Starting
- Android Emulator HAXM / Hypervisor Error (VT-x, WHPX, AEHD)
- Android Studio Emulator Slow or Laggy
- Android Studio Device Offline or Not Detected (ADB)
- Android Studio Gradle Build Slow
- Android Studio SDK Location Not Found
- Android Studio Build Failed: JDK, Gradle or AGP Version Mismatch