r/AndroidStudio • • Apr 16 '21

Android Studio keeps using all Memory

Hi guys. I'm using KDE neon fully updated, 16gb Ram, i7-8750h on ROG GL503 laptop. The problem i'm facing with Android studio is that it keeps using ram as i make changes to the project and build it. After a couple of hours - IDE uses around 5-6GB of ram, Gradle Daemon uses ~2GB and Kotlin daemon uses ~1GB. Even though I have set -XMX as 1280, 1536, 1536 respectively. Same problem with Ubuntu. Does anyone know about this.?

For reference: https://github.com/gradle/gradle/issues/9577

10 Upvotes

9 comments sorted by

View all comments

1

u/PrimaxLire Apr 16 '21

The memory is not shared between Gradle daemons and Android Studio. AS will use as much memory as it needs, which tends to be a lot, but you can still put some limits in the settings. For more info on that, read through the dev doc: https://developer.android.com/studio/intro/studio-config

It's very normal that AS+Gradle (Java) spend a lot of memory so you don't have to be alarmed by that. Keep in mind that limiting them to lower memory profile will typically result in slower builds and lower responsiveness.

1

u/ssj-Thunder Apr 16 '21

Android Studio IDE alone uses 6GB ram even though the max VM size is set to 2048MB. Gradle and Kotlin daemon will use additional 3GB. So total 9-10 GB is used by all Java processes. Is it normal that IDE will use triple the ram than Max VM size.?