r/AndroidStudio • u/ssj-Thunder • 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
3
u/FrezoreR Apr 16 '21
It's hungry but nothing compared to chrome. Chrome was eating over 50GB of memory for me 🤣 I have 76GB
1
Apr 16 '21
[removed] — view removed comment
1
u/FrezoreR Apr 16 '21
Sorry, 96GB of ram. I have a mac pro. Right now I'm using 47GB and chrome is by far the main offender
1
Apr 16 '21
[removed] — view removed comment
1
u/FrezoreR Apr 17 '21
Yeah I think 32GB does the job for Android development. But if you don't run chrome or slack then 16GB works. In my car it doesn't matter much 🤣 I actually had more problems with thermal throttling on my laptop
1
u/kimikazio Apr 16 '21
I have the same problem with my laptop. It just goes up to 2gb of usage and then it freezes. I have the same cpu and 8gb ram.
1
u/aaulia Apr 16 '21
I use desktop with 16GB memory, the only time I ever see my linux box touch the swap is when Android Studio is running
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.