1

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 !

Look at how the heap memory is stuck on 494M

trincot
  • 317,000
  • 35
  • 244
  • 286
Rabih Kadi
  • 61
  • 1
  • 7

1 Answers1

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