diff options
-rw-r--r-- | android/avd/hardware-properties.ini | 8 | ||||
-rw-r--r-- | android/avd/hw-config-defs.h | 7 | ||||
-rw-r--r-- | android/main.c | 8 |
3 files changed, 23 insertions, 0 deletions
diff --git a/android/avd/hardware-properties.ini b/android/avd/hardware-properties.ini index 8744d64..b3e486b 100644 --- a/android/avd/hardware-properties.ini +++ b/android/avd/hardware-properties.ini @@ -154,3 +154,11 @@ type = integer default = 160 abstract = Abstracted LCD density description = Must be one of 120, 160 or 240. A value used to roughly describe the density of the LCD screen for automatic resource/asset selection. + +# Maximum VM heap size +# Higher values are required for high-dpi devices +name = vm.heapSize +type = integer +default = 16 +abstract = Max VM application heap size +description = The maximum heap size a Dalvik application might allocate before being killed by the system. Value is in megabytes. diff --git a/android/avd/hw-config-defs.h b/android/avd/hw-config-defs.h index b98f511..069ae23 100644 --- a/android/avd/hw-config-defs.h +++ b/android/avd/hw-config-defs.h @@ -157,6 +157,13 @@ HWCFG_INT( "Abstracted LCD density", "Must be one of 120, 160 or 240. A value used to roughly describe the density of the LCD screen for automatic resource/asset selection.") +HWCFG_INT( + vm_heapSize, + "vm.heapSize", + 16, + "Max VM application heap size", + "The maximum heap size a Dalvik application might allocate before being killed by the system. Value is in megabytes.") + #undef HWCFG_INT #undef HWCFG_BOOL #undef HWCFG_DISKSIZE diff --git a/android/main.c b/android/main.c index ee1cbdb..6f73571 100644 --- a/android/main.c +++ b/android/main.c @@ -2638,6 +2638,14 @@ int main(int argc, char **argv) hwLcd_setBootProperty(get_device_dpi(opts)); + /* Set the VM's max heap size, passed as a boot property */ + if (hw->vm_heapSize > 0) { + char tmp[32], *p=tmp, *end=p + sizeof(tmp); + p = bufprint(p, end, "%dm", hw->vm_heapSize); + + boot_property_add("dalvik.vm.heapsize",tmp); + } + if (opts->prop != NULL) { ParamList* pl = opts->prop; for ( ; pl != NULL; pl = pl->next ) { |