I keep on trying to increase the heap size inside of android studio, but the memory remains the same, anyone know why? Thanks in advance !
Asked
Active
Viewed 671 times
1
-
What Android studio do you have? how much RAM do you have, how big heap size are you trying to set up? – isaaaaame Feb 26 '19 at 14:33
-
Maybe Android Studio doesn't need it. Did it ever max out? – devgianlu Feb 26 '19 at 14:37
-
We can't know what you might have done wrong since you haven't shown us exactly what you did. – Michael Feb 26 '19 at 14:38
-
Why do you want to increase heap size ? Did you experience OutOfMemory or something related ? – Benoit Feb 26 '19 at 14:50
-
@isaaaaame The latest version, I have 16 gb ram, the heap is stuck at 494 i wanna give it at least 2 gb – Rabih Kadi Feb 26 '19 at 17:31
-
@devgianlu yes it did several times while i was working – Rabih Kadi Feb 26 '19 at 17:31
-
@Benoit it keeps on reminding me that its running on low memory and crashes sometimes – Rabih Kadi Feb 26 '19 at 17:31
-
@Michael i kind of tried everything :/ – Rabih Kadi Feb 26 '19 at 17:31
-
@RabihKadi really important question: have you saved it after editing the settings? – isaaaaame Feb 27 '19 at 09:24
-
1@isaaaaame yes i did, turns out i had to change the path also, thanks all anyways ! – Rabih Kadi Feb 27 '19 at 12:08
1 Answers
1
Click on Help -> Edit Custom VM Options...
. If you don't have any VM options created, it'll prompt you to create one, accept it. Add / modify -Xmx
with amount and type of data you want, like -Xmx8g
for 8gb of heap. You should restart Android Studio afterwards so it'll take effect.
Edit: For more information about studio options, take a look at here.
Edit 2: If you have a problem with jps
, make sure you added up $PATH
for java home. See more details on this answer.

Mel
- 1,730
- 17
- 33
-
That's quite weird. Just to test it out, can you save your VM options to elsewhere then clear out everything except `-XmX` option, and restart ? – Mel Feb 26 '19 at 14:47
-
Can you try to execute `jps -lvm` in Android Studio console after changing ? Take a look at here so you'll see what to expect after executing it, to confirm your heap changes: https://developer.android.com/studio/intro/studio-config.html – Mel Feb 26 '19 at 14:50
-
that's the weirdest part, that jps -lvm is unrecognizable on the console ! – Rabih Kadi Feb 26 '19 at 17:32
-
May you check if you have set `$PATH` for Java home ? Take a look at here -> https://stackoverflow.com/questions/11286669/jps-not-working – Mel Feb 27 '19 at 10:36
-
I'm glad it helped, I'll update the answer accordingly. If you mark it as an accepted answer, it may help others who end up here. Cheers ! – Mel Feb 27 '19 at 13:35