Rohan
Rohan

Reputation: 1

Trying to Increase Heap Size of Emulator in Android Studio

To increase my heap size, I created a new file-studio.exe.vmoptions at

[Directory]/Users/[User Name]/Androidstudio2.1/studio.exe.vmoptions

This is the content of that file:

-server
-Xms256m
-Xmx2048m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-da   -Djna.nosys=true
-Djna.boot.library.path=

-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-Didea.paths.selector=AndroidStudio2.1
-Didea.platform.prefix=AndroidStudio

I don't know if the heap size increased or not, but now Android Studio isn't working: it doesn't open now.

What changes should I make to this file or is it a bug in Android Studio?

Upvotes: 0

Views: 5586

Answers (1)

frogatto
frogatto

Reputation: 29285

First revert back all the changes you've made and then use AVD Manager to increase heap size of your emulator.

  • Tools -> Android -> AVD Manager
  • Select a virtual device and click on its pencil icon (edit)
  • Click on Show Advanced Settings
  • Under "Memory and Storage" change "VM Heap"

enter image description here

Upvotes: 4

Related Questions