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

6

12

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.

Fibrovascular answered 13/12, 2010 at 19:8 Comment(0)
S
2

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.

Sigman answered 3/5, 2011 at 16:20 Comment(2)
And probably find that you have to root it to make it easy to do the things that developers do, thus voiding the warranty.Irmgardirmina
I would recommend not buying any Samsung devices for development, unless it has Vanilla Android, they will not continue support for the deviceExcellence
M
2

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.

Margaretamargarete answered 3/1, 2011 at 1:21 Comment(4)
As noted in Brad Fitzpatrick's discussion already, this setting made no difference.Fibrovascular
If you read carefully Brad discusses "Max VM application heap size". I'm talking about "Device ram size" which is a very different property. It worked for me. Otherwise the default of 96 Mb isn't enough to run background tasks.Margaretamargarete
Didn't make any difference to me either, might be my computer needs more RAM, I though 4 gb would be enough..Excellence
The total RAM value would only make any difference if you were actually running out of it and Android started killing background tasks, and then restarting them. The emulator's performance is slow out of the box - memory has nothing to do with it.Fibrovascular
S
2

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.

Sigman answered 3/5, 2011 at 16:20 Comment(2)
And probably find that you have to root it to make it easy to do the things that developers do, thus voiding the warranty.Irmgardirmina
I would recommend not buying any Samsung devices for development, unless it has Vanilla Android, they will not continue support for the deviceExcellence
S
1

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.

Succinctorium answered 13/12, 2010 at 19:23 Comment(7)
What do you mean by "give more memory"?Jotun
@yuku when you create an AVD you can assign it an amount of RAMHeader
Do you mean the "Max VM application heap size" option when making the AVD? If so, what should it be?Fibrovascular
I see the default setting is 24, so I set it to 128. Saw no difference - performance is still dog slow. Am I tweaking the wrong value?Fibrovascular
@Artem it’s "Device ram size".Lapillus
Ah, found it. Just tried it - didn't notice any difference either. Still much slower and choppier than 2.2Fibrovascular
ACK. It slightly helped, but it is still agonizigly slow.Interchangeable
H
1

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.

Hypnotist answered 28/1, 2011 at 1:38 Comment(3)
Tried these exact settings - no visible difference for me.Fibrovascular
Changing the MAX VM application heap size to 500 is not really that appropriate. This is stating that each application can use up to 500 MB of data themselves. Up until recently the Delvic VM could only support something less than 48 MB total. As far as I know the device with the most VM budget is the Xoom and I believe it has 48 MB. Also a single application should not be able to use all the resources of an android device. Also remember that there are other applications. I know that the Android Services app requires around 50MB, and other native hardware/processes need a slice of that ram.Sigman
@Sigman thanks for the catch; that was a typo that should have been 50 but 48 makes sense if that's what the Xoom uses. I'll update my answer.Hypnotist
S
0

My Suggestions:

Only attach an SD Card if you need it and most likely don't allocate more then you need. This must be emulated in some fashion.

Any other properties should not be inflated beyond your target device. If you increase the VM application heap size and you exceed values of real devices they will have crashes that you did not even notice during development.

Admittedly the defaults are not enoughs for certain applications and the Device Ram should be at least 258 to the limits of your target android device. Also remember that if your development host machine is low on memory then the memory you allocated for your emulator will have to be swapped and providing a smaller amount will avoid unnecessary page hits.

Sigman answered 1/3, 2011 at 21:37 Comment(0)
O
0

After changing the screen resolution, the device ram, letting the device "warm up" and running on fresh new hardware I recorded the Honeycomb emulator speed.

Result at: http://www.youtube.com/watch?v=-7OR8vPsIak

I find it not much different then Gingerbread on older hardware. I do hope the host-accelerated GL finds its way to the SDK soon. For now plain development might be possible, but UX creation or demoing is impossible.

Octans answered 24/4, 2011 at 8:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.