From c839b2515e833ced7f8b3d0d47df62082d007384 Mon Sep 17 00:00:00 2001 From: Davide Garberi Date: Sun, 23 Feb 2020 14:23:53 +0100 Subject: sdm660-common: init: Rework dalvik heap values * Fixup some wrong values * Add support for 6gb devices Change-Id: I82eba78f85afe6dfa5cd0eb7e86e997a0b72e929 --- init/init_sdm660.cpp | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'init') diff --git a/init/init_sdm660.cpp b/init/init_sdm660.cpp index 6d58717..63e7d79 100644 --- a/init/init_sdm660.cpp +++ b/init/init_sdm660.cpp @@ -49,6 +49,7 @@ char const *heapgrowthlimit; char const *heapsize; char const *heapminfree; char const *heapmaxfree; +char const *heaptargetutilization; void check_device() { @@ -56,20 +57,30 @@ void check_device() sysinfo(&sys); - if (sys.totalram > 3072ull * 1024 * 1024) { - // from - phone-xxhdpi-4096-dalvik-heap.mk + if (sys.totalram > 5072ull * 1024 * 1024) { + // from - phone-xhdpi-6144-dalvik-heap.mk heapstartsize = "16m"; heapgrowthlimit = "256m"; heapsize = "512m"; - heapminfree = "4m"; - heapmaxfree = "8m"; - } else if (sys.totalram > 2048ull * 1024 * 1024) { - // from - phone-xxhdpi-3072-dalvik-heap.mk + heaptargetutilization = "0.5"; + heapminfree = "8m"; + heapmaxfree = "32m"; + } else if (sys.totalram > 3072ull * 1024 * 1024) { + // from - phone-xxhdpi-4096-dalvik-heap.mk + heapstartsize = "8m"; + heapgrowthlimit = "256m"; + heapsize = "512m"; + heaptargetutilization = "0.6"; + heapminfree = "8m"; + heapmaxfree = "16m"; + } else { + // from - phone-xhdpi-2048-dalvik-heap.mk heapstartsize = "8m"; - heapgrowthlimit = "288m"; - heapsize = "768m"; + heapgrowthlimit = "192m"; + heapsize = "512m"; + heaptargetutilization = "0.75"; heapminfree = "512k"; - heapmaxfree = "8m"; + heapmaxfree = "8m"; } } @@ -80,7 +91,7 @@ void vendor_load_properties() property_set("dalvik.vm.heapstartsize", heapstartsize); property_set("dalvik.vm.heapgrowthlimit", heapgrowthlimit); property_set("dalvik.vm.heapsize", heapsize); - property_set("dalvik.vm.heaptargetutilization", "0.75"); + property_set("dalvik.vm.heaptargetutilization", heaptargetutilization); property_set("dalvik.vm.heapminfree", heapminfree); property_set("dalvik.vm.heapmaxfree", heapmaxfree); } -- cgit v1.2.3