My 4GB RAM, Intel Core i5 system came down down to its knees with high disk and RAM usage by Android Studio(I can see it in the task manager, nothing else is using the RAM and disk). The gradle build takes about 10-15 mins for a simple project.
Is there any solution?
You need to upgrade your PC though but there are few things you can do to make it faster
1. Increase the memory size of Android Studio:
Open the file located at /bin/studio.vmoptions and Change the content from
to
Xms specifies the initial memory allocation pool. Your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory.
Save the studio.vmoptions file and restart Android Studio.
2. Improve Gradle performance:
Create a file named gradle.properties in
and add the line:
This helps a lot, with
org.gradle.daemon
set to trueGradle
reuses computations from previous builds and cache information about project structure, files, tasks etc. in memory so it won’t have to start up the entireGradle
application every time.Source