device.mk: Add options to make things perform a bit better in lowmemory situations

Message ID 1493417743-19617-1-git-send-email-john.stultz@linaro.org
State New
Headers show

Commit Message

John Stultz April 28, 2017, 10:15 p.m.
With the db410c especially, the memory constraints are very
tight, so try to eek out a bit more memory by setting some
options suggested by Bero.

Cc: Rob Herring <rob.herring@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Vishal Bhoj <vishal.bhoj@linaro.org>
Cc: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>

---
 Kconfig                  | 7 +++++++
 configs/db410c_defconfig | 1 +
 device.mk                | 8 ++++++++
 3 files changed, 16 insertions(+)

-- 
2.7.4

Patch hide | download patch | download mbox

diff --git a/Kconfig b/Kconfig
index 555127a..b0b48f3 100644
--- a/Kconfig
+++ b/Kconfig
@@ -143,6 +143,13 @@  config DALVIK_VM_HEAPGROWTHLIMIT
 	help
 	  Typically this is less than half the heap size.
 
+config LOWMEM_CONFIG
+	bool "Enable Lowmem Configuration"
+	default false
+	help
+	  Enables some of the reccomended low-memory options for devices
+	  with 1GB or less RAM.
+
 endmenu
 
 menu "Image Configuration"
diff --git a/configs/db410c_defconfig b/configs/db410c_defconfig
index 2923287..e13ad04 100644
--- a/configs/db410c_defconfig
+++ b/configs/db410c_defconfig
@@ -1,5 +1,6 @@ 
 CONFIG_PRODUCT_DEVICE="db410c"
 CONFIG_DALVIK_VM_HEAPSIZE=32
+CONFIG_LOWMEM_CONFIG=y
 CONFIG_BOARD_SYSTEMIMAGE_PARTITION_SIZE=1288491008
 CONFIG_BOARD_USERDATAIMAGE_PARTITION_SIZE=5653544960
 CONFIG_KERNEL=y
diff --git a/device.mk b/device.mk
index 1071301..85a74d9 100644
--- a/device.mk
+++ b/device.mk
@@ -75,6 +75,14 @@  PRODUCT_PROPERTY_OVERRIDES += \
     dalvik.vm.heapminfree=512k \
     dalvik.vm.heapmaxfree=$(CONFIG_DALVIK_VM_HEAPMAXFREE)m
 
+
+ifneq ($(CONFIG_LOWRAM_CONFIG),)
+PRODUCT_PROPERTY_OVERRIDES += \
+    ro.config.low_ram=true \
+    dalvik.vm.jit.codecachesize=0 \
+endif
+
+
 subdirs-true := lights graphics
 subdirs-$(CONFIG_WIFI) += wifi
 subdirs-$(CONFIG_ETHERNET) += ethernet