Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gingerbread emulator instance is much more sluggish than Froyo and below. Why?

I'm not sure if anyone else noticed it, but the Gingerbread emulator runs like a dog, with both scrolling, navigating, interaction - all taking much longer and being much choppier. I even got an ANR in the browser when I tried to use it: http://www.androidpolice.com/2010/12/06/walkthrough-and-hands-on-with-the-gingerbread-ui-the-new-gingerbread-keyboard-in-all-its-sexiness/ (see towards the bottom).

I've just read about the new StrictMode at http://android-developers.blogspot.com/2010/12/new-gingerbread-api-strictmode.html and about all the performance improvements in Gbread, but my experience so far suggests just the opposite.

Can we get to the bottom of this? I find myself dreading bringing up an instance of Gingerbread at this point.

like image 458
Artem Russakovskii Avatar asked Dec 13 '10 19:12

Artem Russakovskii


4 Answers

All the answers above have their merits and should be considered but keep in mind Google implementation of a virtual machine for simulating devices is not exactly as good as those from Microsoft and Apple there may not be much you can do but make sure you optimize the configuration and getting a better machine.

With the introduction of Honeycomb the android system is using more graphics power to do the rendering of the UI. This when run on a simulator can not natively use the graphical power of your PC hardware but most emulate the hardware on the phone which always results in lose of performance. More generic X86 emulators have become available such as VMWare but this may take some time to be available to the Android SDK. Until an X86 port of Android Honeycomb is available that can take advantage of your native GPU the emulator will be sluggish.

The only real solution is to buy a Honeycomb device for development work.

like image 54
ddcruver Avatar answered Nov 15 '22 19:11

ddcruver


When you create your new GingerBread (API level 9) AVD, give it a realistic amount of RAM.

For example the Nexus S has 512MB

You do this in the "Create new Android Virtual Device (AVD)" Dialog.

Press "New..." to add a new hardware parameter and choose "Device ram size", click OK.

Edit the default amount from 96 to 512.

like image 43
byeo Avatar answered Nov 15 '22 20:11

byeo


I saw a discussion of this elsewhere which suggested that the emulator parameters weren't setup well. If you give the emulator more memory it apparently becomes much more usable.

like image 1
Brad Fitzpatrick Avatar answered Nov 15 '22 18:11

Brad Fitzpatrick


Now that you can easily edit AVDs, I have tried playing around with some of the settings for my Gingerbread AVD, and it's finally pretty usable.

  • SD Card: 500MiB
  • Skin: WVGA800
  • Abstracted LCD density: 240
  • Cache partition size: 128MB
  • Max VM application heap size: 48
  • Device ram size: 512

My guess is that the RAM and max VM heap are the most important ones, but I figured it'd be better to include all of the settings, so you can try these out as a starting point and then tweak.

like image 1
Ian G. Clifton Avatar answered Nov 15 '22 18:11

Ian G. Clifton