47

I'm not able to change the ram size in the memory and storage section of the AVD manager in the android studio. I wanted the emulator to run a little faster (I have 8GB RAM). The controls are completely gray out.

Here is the screenshot

James Z
  • 12,209
  • 10
  • 24
  • 44
Girish venkata
  • 704
  • 1
  • 7
  • 15

9 Answers9

77

If you create an AVD with "Recommended" system image then you can't change the "Memory and Storage" parameters neither when you create AVD nor when you edit your AVD.

enter image description here

Solution:

You should select your "Image" from "x86 Images" tab and then change "Memory and Storage" parameters in the next page.

Hossein Rashno
  • 3,073
  • 1
  • 25
  • 49
  • 12
    This didn't solved for me, see stackoverflow.com/q/55713335/7678788 – Chirag Jain Apr 19 '19 at 02:58
  • 2
    It is actually to do with whether the image has Google Play or not. Your solution will work in most cases, as AVD Manager usually lists the Google Play images on the Recommended tab and others on the "x86 Images" tab. But (a) if the hardware profile doesn't support Google Play then you will be able to select from the Recommended tab just fine, (b) even some "x86 images" support Google Play as you can see from the screenshot in rahulserver's answer. So TL;DR - the issue is not with whether it's on the Recommended tab, it's to do with whether it's Google Play, but the two correlate in most cases – Adam Burley May 28 '21 at 10:20
30

Look for your avd folder, then look for the folder of the image you want to change and edit the config.ini. change the value of

hw.ramSize

Etta
  • 339
  • 4
  • 10
  • 6
    On my macOS system, this file was in `~/.android/avd/NAMEHERE.avd/config.ini` and `cat /proc/meminfo` in `adb shell` confirms that it works. The emulator crashed when adding 4096M but 3500M seems to be fine. – that other guy Sep 09 '20 at 23:42
  • Yeah I got also crash if I set too low or too high value, it should be about twice a device memory – Borzh Dec 15 '20 at 21:15
  • I found that if I set values over 4.1GB (e.g. set to 8GB) it will stay at 4.1GB as the maximum – Adam Burley May 28 '21 at 10:29
29

It happened to me with an image with the pre-installed playstore app. Maybe it is an android SDK bug. Try to create one with no playstore app.

Daniele
  • 1,332
  • 1
  • 13
  • 24
22

Here is a solution for Android 4.1 that worked for me.

  1. Create AVD as usual over AVD Manager
  2. Open location on the disk where AVD data is saved enter image description here
  1. open the config file that is there over the notepad. Inside should be a line that starts with the hw.ramSize line. There you should change the number of MB you want. Save changes, close file.
  2. In Android Studio click File > Reload All from Disk
  3. If you select View Details you should see there that ram size is changed now.

I hope it will help.

PythonMan
  • 787
  • 10
  • 18
  • 2
    This worked flawlessly, although had to restart Android Studio for changes to take effect. Reload all from Disk didn't work with me. – Solly Dec 14 '20 at 14:40
3

Further adding to the answer by Fresher, it seems that even x86 images don't work(atleast its the case with my mac OS). Here is the screenshot: enter image description here

Advanced Settings: enter image description here

What worked for me: I just used "Clone Device" in Hardware selection wizard(the first one that opens after you click on the "AVD manager" enter image description here Then setup your ram here: enter image description here Once you hit "Finish", you will see your cloned device appear in the hardware selection wizard like this: enter image description here

Then go ahead as usual.

rahulserver
  • 10,411
  • 24
  • 90
  • 164
  • 2
    The problem is that cloned profiles don't support Google Play images. So in your case, the original "Pixel 2" profile will support Google Play, but "Pixel 2 (Edited)" won't support Google Play. When you get to the image selection screen, you will be forced to select an image without Google Play. You could just do that to begin with, select an image without Google Play (without cloning the device) and you won't get this "greyed out" issue. – Adam Burley May 28 '21 at 10:17
3

You can do so by editing the config.ini file of the int the avd settings look for this

>hw.ramSize
Pouria Hemi
  • 706
  • 5
  • 15
  • 30
2

Editing is disabled,but you can create a new virtual device by using Clone Device.. option.Once installation of OS is complete, edit the RAM again in Advanced Settings before clicking Finish.

fresher
  • 77
  • 5
  • This appears to be untrue. – Joshua Gross Mar 19 '19 at 05:07
  • 1
    This is true in my version (3.4 on Win) but not if you clone from the devices overview. Now inside the `Create New Virtual Device` dialogue the `Clone Device..` button creates an editable instance of whatever device is selected. –  May 01 '19 at 17:52
  • Matt Bracewell's way is right in my case, Thank you – yane May 26 '19 at 06:31
  • The problem is that cloned profiles don't support Google Play images. After selecting a cloned device, when you get to the image selection screen, you will be forced to select an image without Google Play. You could just do that to begin with, select an image without Google Play (without cloning the device) and you won't get this "greyed out" issue. – Adam Burley May 28 '21 at 10:17
2

just get the emulator whith api which has no google play from x86 images,just set your ram size, then change image to the api which has google play it has worked for me creating

changing ram size

changing android image

selecting android image

It has worked and I have play market

Wodota ML
  • 76
  • 5
0

First of all the top answer is wrong, you can change the storage with recommended settings, but you can't change the memory amount, that is, the physical ram or virtual ram, on the device.

What you need to do is go to your virtual device manager in studio. Create a new device, at the select hardware screen, whatever type of virtual device you are going to be using, go find it in the list say, Pixel 6 or whatever, and right click the pixel 6 and click clone. Then while you have that selected, right click and select edit profile. Or you can just click new hardware profile and build it from scratch.

Whichever route you choose just name the clone or the new profile to MYPIXEL or something distinguishable from the rest of the group, whatever. Then go down to the section where it has the virtual memory and the physical memory, and storage and input whatever values you want. Remember, you're not setting these values for the amount your device will have when you boot it up here, this is just the hardware profile where you are setting the maximum allowance for the device just be mindful of that you still have to change the settings on the verification page to the value that you want

So now when you set the hardware profile wherever you want it to be, save it click okay and then make sure you have it selected when you click next to go select your system image. Pick your system image and then click next again, and then this is the verify configuration screen, you still have to expand the advanced options and configure the particular values you want for virtual and physical and storage space. now you'll see when you go into the advance configuration options you can modify the virtual and physical memory. because when you open it up it's still going to have that standard 2038 MB or whatever the number is because that is the default amount for that particular device but you will be able to change it to whatever maximum threshold you set.

That's how you do it the right way from the beginning.