config: reduce memory footprint
- add flag Change-Id: Ifc84bbd8e4790ff0dab33368d9ac45158e7c47fc Co-authored-by: Ghosuto <clash.raja10@gmail.com> Signed-off-by: Ghosuto <clash.raja10@gmail.com>
This commit is contained in:
@@ -7,6 +7,12 @@ $(call inherit-product, vendor/google/overlays/ThemeIcons/config.mk)
|
||||
|
||||
PRODUCT_BRAND ?= MistOS
|
||||
|
||||
# Low ram profile
|
||||
TARGET_USE_LOWRAM_PROFILE ?= false
|
||||
ifeq ($(TARGET_USE_LOWRAM_PROFILE),true)
|
||||
$(call inherit-product, vendor/lineage/config/defaults_common.mk)
|
||||
endif
|
||||
|
||||
# Allow vendor prebuilt repos to exclude themselves from bp scanning
|
||||
-include $(sort $(wildcard vendor/*/*/exclude-bp.mk))
|
||||
|
||||
|
||||
34
config/defaults_common.mk
Normal file
34
config/defaults_common.mk
Normal file
@@ -0,0 +1,34 @@
|
||||
# Speed profile services and wifi-service to reduce RAM and storage.
|
||||
PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := speed-profile
|
||||
PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER := speed-profile
|
||||
|
||||
# Do not generate libartd.
|
||||
PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := false
|
||||
|
||||
# Strip the local variable table and the local variable type table to reduce
|
||||
# the size of the system image. This has no bearing on stack traces, but will
|
||||
# leave less information available via JDWP.
|
||||
PRODUCT_MINIMIZE_JAVA_DEBUG_INFO := true
|
||||
|
||||
# Always preopt extracted APKs to prevent extracting out of the APK for gms
|
||||
# modules.
|
||||
PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK := true
|
||||
|
||||
# Use a profile based boot image for this device. Low ram optimized taken from atv devices.
|
||||
PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE := true
|
||||
PRODUCT_COPY_FILES += vendor/lineage/product/lowram_boot_profiles/preloaded-classes:system/etc/preloaded-classes
|
||||
PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION := vendor/lineage/product/lowram_boot_profiles/boot-image-profile.txt
|
||||
|
||||
PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST += \
|
||||
system/etc/preloaded-classes.txt
|
||||
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
dalvik.vm.madvise.vdexfile.size=31457280\
|
||||
dalvik.vm.madvise.odexfile.size=31457280\
|
||||
dalvik.vm.madvise.artfile.size=0
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
LowProfileOverlay
|
||||
|
||||
TARGET_SYSTEM_PROP += \
|
||||
vendor/lineage/config/defaults_common.prop
|
||||
18
config/defaults_common.prop
Normal file
18
config/defaults_common.prop
Normal file
@@ -0,0 +1,18 @@
|
||||
# Set lowram options
|
||||
ro.lmk.critical_upgrade=true
|
||||
ro.lmk.upgrade_pressure=40
|
||||
ro.lmk.downgrade_pressure=60
|
||||
ro.lmk.kill_heaviest_task=false
|
||||
ro.lmk.medium=700
|
||||
|
||||
# set threshold to filter unused apps
|
||||
pm.dexopt.downgrade_after_inactive_days=10
|
||||
|
||||
# Default heap sizes. Allow up to 256m for large heaps to make sure a single app
|
||||
# doesn't take all of the RAM.
|
||||
dalvik.vm.heapgrowthlimit=128m
|
||||
dalvik.vm.heapsize=256m
|
||||
dalvik.vm.madvise-random=true
|
||||
|
||||
# disable machine learning
|
||||
ro.nnapi.extensions.deny_on_product=true
|
||||
6
overlay/LowProfileOverlay/Android.bp
Normal file
6
overlay/LowProfileOverlay/Android.bp
Normal file
@@ -0,0 +1,6 @@
|
||||
runtime_resource_overlay {
|
||||
name: "LowProfileOverlay",
|
||||
certificate: "platform",
|
||||
sdk_version: "current",
|
||||
product_specific: true
|
||||
}
|
||||
6
overlay/LowProfileOverlay/AndroidManifest.xml
Normal file
6
overlay/LowProfileOverlay/AndroidManifest.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="android.overlay.lowram.target.overlay">
|
||||
<overlay android:isStatic="true" android:priority="600" android:targetName="LowProfileOverlay" android:targetPackage="android"/>
|
||||
|
||||
<application android:hasCode="false" android:label="LowProfileOverlay"/>
|
||||
</manifest>
|
||||
19
overlay/LowProfileOverlay/res/values/config.xml
Normal file
19
overlay/LowProfileOverlay/res/values/config.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2024-2025 Lunaris OS
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<resources>
|
||||
<!-- The amount to scale fullscreen snapshots for Overview and snapshot starting windows. -->
|
||||
<item name="config_highResTaskSnapshotScale" format="float" type="dimen">0.6</item>
|
||||
</resources>
|
||||
59164
product/lowram_boot_profiles/boot-image-profile.txt
Normal file
59164
product/lowram_boot_profiles/boot-image-profile.txt
Normal file
File diff suppressed because it is too large
Load Diff
17533
product/lowram_boot_profiles/preloaded-classes
Normal file
17533
product/lowram_boot_profiles/preloaded-classes
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user