Skip to content

Commit

Permalink
调整参数
Browse files Browse the repository at this point in the history
  • Loading branch information
HChenX committed Dec 10, 2023
1 parent 06d2e79 commit 13582c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
12 changes: 7 additions & 5 deletions memory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ setVm() {
#设置cache参数
{
echo "- [i]:设置cache参数"
setValue 5 /proc/sys/vm/dirty_background_ratio
setValue 2 /proc/sys/vm/dirty_background_ratio
setValue 80 /proc/sys/vm/dirty_ratio
setValue 2000 /proc/sys/vm/dirty_expire_centisecs
setValue 300 /proc/sys/vm/dirty_writeback_centisecs
setValue 250 /proc/sys/vm/dirty_writeback_centisecs
setValue 150 /proc/sys/vm/vfs_cache_pressure
#设置其它vm参数
echo "- [i]:设置其它vm参数"
Expand All @@ -121,15 +121,15 @@ setVm() {
# io调试开关
setValue 0 /proc/sys/vm/block_dump
# vm 状态更新频率
setValue 20 /proc/sys/vm/stat_interval
setValue 5 /proc/sys/vm/stat_interval
# 是否允许过量使用运存
# setValue 200 /proc/sys/vm/overcommit_ratio
setValue 1 /proc/sys/vm/overcommit_memory
# 触发oom后怎么抛异常
setValue 0 /proc/sys/vm/panic_on_oom
# 此参数决定了内核在后台应该压缩内存的力度。参数取 [0, 100] 范围内的值
# 待测试
setValue 20 /proc/sys/vm/compaction_proactiveness
# 默认20,待测试
setValue 30 /proc/sys/vm/compaction_proactiveness
# 压缩内存节省空间(会导致kswap0异常)
# setValue 1 /proc/sys/vm/compact_memory
# watermark_boost_factor用于优化内存外碎片化
Expand Down Expand Up @@ -163,6 +163,8 @@ echo "手机品牌:$(getprop ro.product.brand)" >"$HChen"/log.txt
echo "AppRetention下载地址:https://github.com/HChenX/AppRetentionHook"
}
echo "---------------------------------------------------------------------------"
# 更改selinux规则
magiskpolicy --live "allow system_server * * *"
device_config set_sync_disabled_for_tests persistent
settings put global settings_enable_monitor_phantom_procs false
device_config put activity_manager max_cached_processes 2147483647
Expand Down
2 changes: 0 additions & 2 deletions service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Wait_until_login() {
while [ ! -d "/sdcard/Android" ]; do sleep 1; done
}
Wait_until_login
# 更改selinux规则
magiskpolicy --live "allow system_server * * *"
{ [[ -f /system/bin/sh ]] && {
/system/bin/sh $HChen/memory.sh
}; } || {
Expand Down
9 changes: 1 addition & 8 deletions system.prop
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ ro.lmk.low=1001
ro.lmk.medium=1001
ro.lmk.critical=1001
ro.lmk.swap_util_max=100
ro.lmk.thrashing_limit=100
ro.lmk.thrashing_limit_decay=10
ro.lmk.swap_free_low_percentage=1
ro.lmk.psi_partial_stall_ms=140
ro.lmk.psi_complete_stall_ms=700
ro.lmk.kill_heaviest_task=false
ro.lmk.swap_is_low_kill_enable=0
ro.lmk.limit_killing_array_kb=4,4,4,4
persist.vendor.duraspeed.support=0
persist.vendor.duraspeed.lowmemory.enable=0
ro.lmk.swap_is_low_kill_enable=0

0 comments on commit 13582c7

Please sign in to comment.