Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

RESTORED drop RAM cache Cron job. requested by users, set as OFF.

  • Loading branch information...
commit 8a2ff436135a13f1dda8ab4a5aa95e1718231ca8 1 parent 85cf74a
Yuri.Sh authored
29 res/crontab/cron-scripts/drop-cache-only.sh
View
@@ -0,0 +1,29 @@
+#!/sbin/busybox sh
+
+PROFILE=`cat /data/.siyah/.active.profile`;
+. /data/.siyah/$PROFILE.profile;
+
+if [ "$cron_drop_cache" == "on" ]; then
+
+ MEM_ALL=`free | grep Mem | awk '{ print $2 }'`;
+ MEM_USED=`free | grep Mem | awk '{ print $3 }'`;
+ MEM_USED_CALC=$(($MEM_USED*100/$MEM_ALL));
+
+ # do clean cache only if cache uses 50% of free memory.
+ if [ "$MEM_USED_CALC" \> 50 ]; then
+
+ # wait till CPU is idle.
+ while [ ! `cat /proc/loadavg | cut -c1-4` \< "3.50" ]; do
+ echo "Waiting For CPU to cool down";
+ sleep 30;
+ done;
+
+ sync;
+ sysctl -w vm.drop_caches=3
+ sync;
+ sysctl -w vm.drop_caches=1
+ sync;
+ date +%H:%M-%D-%Z > /data/crontab/cron-clear-ram-cache;
+ echo "Cache above 50%! Cleaned RAM Cache" >> /data/crontab/cron-clear-ram-cache;
+ fi;
+fi;
1  res/crontab_service/root
View
@@ -1 +1,2 @@
# This file is at /system/etc/cron.d/crontabs/root
+0 0-23/1 * * * /sbin/busybox sh /data/crontab/cron-scripts/drop-cache-only.sh
1  res/customconfig/battery.profile
View
@@ -88,6 +88,7 @@ led_on_touch=off
touchkey_brightness=2700
dyn_brightness=on
crontab=off
+cron_drop_cache=off
cron_clear_app_cache=off
cron_fix_permissions=off
cron_zipaling=off
3  res/customconfig/customconfig.xml
View
@@ -481,6 +481,9 @@
<button description="Use this button to RESET Cron scripts and jobs from kernel to refresh the configuration, This will clear all custom changes!" name="CRON Function Reset" action="push-actions/crontab_reset" label="Reset Cron Files"/>
+ <checkbox description="Cron Task to clear RAM Cache/Buffers every HOUR only if CPU is resting(IDLE)! this will free RAM from buffers and not used cache"
+ name="RAM Cache Clean Task" action="generic_cortex /tmp/cron_drop_cache" label="RAM Cache Clean Every Hour"/>
+
<checkbox description="Cron Task to clear APP cache every 4:00AM only if CPU is resting(IDLE)! this can maintain free space on data partition, and clean all old junk."
name="DISK Clean Task" action="generic_cortex /tmp/cron_clear_app_cache" label="DISK Clean Task Every 4:00AM"/>
1  res/customconfig/default.profile
View
@@ -88,6 +88,7 @@ led_on_touch=off
touchkey_brightness=3000
dyn_brightness=off
crontab=off
+cron_drop_cache=off
cron_clear_app_cache=off
cron_fix_permissions=off
cron_zipaling=off
1  res/customconfig/extreme_battery.profile
View
@@ -88,6 +88,7 @@ led_on_touch=off
touchkey_brightness=2700
dyn_brightness=on
crontab=off
+cron_drop_cache=off
cron_clear_app_cache=off
cron_fix_permissions=off
cron_zipaling=off
1  res/customconfig/extreme_performance.profile
View
@@ -88,6 +88,7 @@ led_on_touch=off
touchkey_brightness=3000
dyn_brightness=off
crontab=on
+cron_drop_cache=off
cron_clear_app_cache=on
cron_fix_permissions=off
cron_zipaling=on
1  res/customconfig/performance.profile
View
@@ -88,6 +88,7 @@ led_on_touch=off
touchkey_brightness=3000
dyn_brightness=on
crontab=on
+cron_drop_cache=off
cron_clear_app_cache=on
cron_fix_permissions=off
cron_zipaling=on
Please sign in to comment.
Something went wrong with that request. Please try again.