views:

88

answers:

2

Does the android simulator use the same amount of memory as the real device? For example if my app doesn't run out of memory on a simulator, does it mean that it doesn't run out of memory on an actual device?

+3  A: 

When you set up an emulator, you can specify the amount of memory. Here's an example blog post where someone explains the configurations of various common Android devices.

http://mobile.tutsplus.com/tutorials/android/common-android-virtual-device-configurations/

Matt Huggins
the map heap size per app is limited to 16/24/48MB on a real device depending on the device. The emulator usually is limited to 16MB per app just like on of the older devices like G1. This parameter you cannot set when creating an avd, but you can pass it as parameter when launching the emulator, i.e.: -prop dalvik.vm.heapsize=24m This way you can also simulate the correct 'heap per app' size correctly for your device.
Mathias Lin
thanks a lot can you please tell me how i can run the simulator using that code? I'm on a mac
aryaxt
@aryaxt - are you running an IDE like Eclipse, or are you simply launching from the command line?
Matt Huggins
mmm i usually run it from eclipse, but i can run it from command line as well, do i simply add what u mentioned at the end of my command?"emulator -avd <myEmulator> -prop dalvik.vm.heapsize=24m" something like this?
aryaxt
+1  A: 

It can be configured based on the OS version. Check this link from android dev page.

Praveen S