听说这是一个适应所有rom的v6脚本
【注:转!】
1、V6SuperCharger通过调整android原生自带任务管理机来优化内存,可以让手机保持120M空闲内存
2、从此抛弃任务管理器,享受android即linux原生内存管理的优势!
3、适用于任何ROM,在小运存ROM上效果明显
原帖地址:http://forum.xda-developers.co
注:ICS不能本文教程、前提条件:
你的ROM需要支持/system/etc/init.d和/data,这些可以用厨房搞定,不多赘述。
一、在/system/etc/init.d文件夹下a.建立一个文本文件,去掉扩展名,名为:99SuperCharger
用文本方式打开,复制入以下代码:
#!/system/bin/sh
#V6
SuperCharger,OOMGrouping&undefinedriorityFixescreatedby
zeppelinrox.
execute=0;
currentadj=`cat/sys/module/lowmemorykiller/parameters/adj`;
currentminfree=`cat/sys/module/lowmemorykiller/parameters/minfree`;
scadj=`cat
/data/SuperChargerAdj`;
scminfree=`cat
/data/SuperChargerMinfree`;
if[
"$currentadj"!="$scadj"];then
execute=1;
elif[[-n
"$scminfree"]]&&["$currentminfree"!="$scminfree"];
then
execute=1;
fi;
if[
"$execute"-eq1];then
mount-o
remount,rw/system2>/dev/null;
formin
/dev/block/mtdblock*;
do
mount-o
remount,rw$m/system2>/dev/null;
done;
echo$scadj
>/sys/module/lowmemorykiller/parameters/adj;
echo$scminfree
>/sys/module/lowmemorykiller/parameters/minfree;
sed-i
'/.*_ADJ/d'/system/build.prop;
sed-i
'/.*_MEM/d'/system/build.prop;
busyboxsysctl
-wvm.oom_kill_allocating_task=0;
busyboxsysctl
-wvm.panic_on_oom=0;
busyboxsysctl
-wkernel.panic_on_oops=1;
busyboxsysctl
-wkernel.panic=0;
mount-o
remount,ro/system2>/dev/null;
formin
/dev/block/mtdblock*;
do
mount-o
remount,ro$m/system2>/dev/null;
done;
fi;
#EndofV6
SuperChargedEntries
sh
/data/99SuperCharger.sh;
保存退出。
b.建立一个文本文件,去掉扩展名,名为:98TweakKernel
复制以下代码:
#!/system/bin/sh
#Puttogether
andrefinedbyzeppelinrox.Seeincludedlinksforresources.
mount-o
remount,rw/system2>/dev/null;
formin
/dev/block/mtdblock*;
do
mount-o
remount,rw$m/system2>/dev/null;
done;
busyboxsysctl
-p;
#
#Disable
normalizedsleeper
#
mount-t
debugfsnone/sys/kernel/debug2>/dev/null;
echo
NO_NORMALIZED_SLEEPER
>/sys/kernel/debug/sched_features2>/dev/null;
#
#Memory
management
busyboxsysctl
-e-wvm.oom_kill_allocating_task=0;
busyboxsysctl
-e-wvm.panic_on_oom=0;
busyboxsysctl
-e-wvm.dirty_background_ratio=60;
busyboxsysctl
-e-wvm.dirty_ratio=95;
busyboxsysctl
-e-wvm.min_free_kbytes=8192;
【注:转!】
1、V6SuperCharger通过调整android原生自带任务管理机来优化内存,可以让手机保持120M空闲内存
2、从此抛弃任务管理器,享受android即linux原生内存管理的优势!
3、适用于任何ROM,在小运存ROM上效果明显
原帖地址:http://forum.xda-developers.co
注:ICS不能本文教程、前提条件:
你的ROM需要支持/system/etc/init.d和/data,这些可以用厨房搞定,不多赘述。
一、在/system/etc/init.d文件夹下a.建立一个文本文件,去掉扩展名,名为:99SuperCharger
用文本方式打开,复制入以下代码:
#!/system/bin/sh
#V6
SuperCharger,OOMGrouping&undefinedriorityFixescreatedby
zeppelinrox.
execute=0;
currentadj=`cat/sys/module/lowmemorykiller/parameters/adj`;
currentminfree=`cat/sys/module/lowmemorykiller/parameters/minfree`;
scadj=`cat
/data/SuperChargerAdj`;
scminfree=`cat
/data/SuperChargerMinfree`;
if[
"$currentadj"!="$scadj"];then
execute=1;
elif[[-n
"$scminfree"]]&&["$currentminfree"!="$scminfree"];
then
execute=1;
fi;
if[
"$execute"-eq1];then
mount-o
remount,rw/system2>/dev/null;
formin
/dev/block/mtdblock*;
do
mount-o
remount,rw$m/system2>/dev/null;
done;
echo$scadj
>/sys/module/lowmemorykiller/parameters/adj;
echo$scminfree
>/sys/module/lowmemorykiller/parameters/minfree;
sed-i
'/.*_ADJ/d'/system/build.prop;
sed-i
'/.*_MEM/d'/system/build.prop;
busyboxsysctl
-wvm.oom_kill_allocating_task=0;
busyboxsysctl
-wvm.panic_on_oom=0;
busyboxsysctl
-wkernel.panic_on_oops=1;
busyboxsysctl
-wkernel.panic=0;
mount-o
remount,ro/system2>/dev/null;
formin
/dev/block/mtdblock*;
do
mount-o
remount,ro$m/system2>/dev/null;
done;
fi;
#EndofV6
SuperChargedEntries
sh
/data/99SuperCharger.sh;
保存退出。
b.建立一个文本文件,去掉扩展名,名为:98TweakKernel
复制以下代码:
#!/system/bin/sh
#Puttogether
andrefinedbyzeppelinrox.Seeincludedlinksforresources.
mount-o
remount,rw/system2>/dev/null;
formin
/dev/block/mtdblock*;
do
mount-o
remount,rw$m/system2>/dev/null;
done;
busyboxsysctl
-p;
#
#Disable
normalizedsleeper
#
mount-t
debugfsnone/sys/kernel/debug2>/dev/null;
echo
NO_NORMALIZED_SLEEPER
>/sys/kernel/debug/sched_features2>/dev/null;
#
#Memory
management
busyboxsysctl
-e-wvm.oom_kill_allocating_task=0;
busyboxsysctl
-e-wvm.panic_on_oom=0;
busyboxsysctl
-e-wvm.dirty_background_ratio=60;
busyboxsysctl
-e-wvm.dirty_ratio=95;
busyboxsysctl
-e-wvm.min_free_kbytes=8192;