[Samsung Epic 4G Touch] helix4u:
Back to what I was playing with last night. I dug at it a little over lunch. Found a few things. Remember, I'm on KO's 4.3A running 3.0.

1. The following lines were duplicated in the file, so I removed the duplicates... don't know why dups would be needed...

sysctl -w fs.file-max=524288

sysctl -w fs.inotify.max_queued_events=32000

sysctl -w fs.inotify.max_user_instances=256

sysctl -w fs.inotify.max_user_watches=10240

2. Removed sysctl -w kernel.hung_task_timeout_secs=30

& sysctl -w kernel.threads-max=524288

The result seems stable and has the least changes to KO's orig script. 4.3A testers anyone?

#!/system/bin/sh
#
# Tweak by Kobridge
# Kobridge Tweak Pack v4.3A for JB
#
# Change Log:
# 01/21/13 v4.3 Fine Tuning based on JB ROM
# 12/21/12 v4.2 hotplug
# 6/6/12 v3.3, v3.4 CFS + Touch tweak + Log file
# 5/22/12 IO/SD read_ahead_kb changes for SF Tweak
# 5/15/12 Replaced lots of tweaks to use sysctl (from previous version)

LOG_FILE=/data/log/kobridge_tweak41.log;

if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;

echo "$( date +"%m-%d-%Y %H:%M:%S" ) 41tweaks_other started " | tee -a $LOG_FILE;

# File System Speed Tweak
echo "$( date +"%m-%d-%Y %H:%M:%S" ) ext4 File system speed tweaks " | tee -a $LOG_FILE;
for k in $(/system/xbin/busybox mount | /system/xbin/busybox grep ext4 | /system/xbin/busybox cut -d " " -f3); do
echo " Processing $k " | tee -a $LOG_FILE;
sync;
/system/xbin/busybox mount -o remount,noatime,noauto_da_alloc,nodev,nodiratime,barrier=0,nobh $k;
done;

#CFS Tweaks
#
echo "$( date +"%m-%d-%Y %H:%M:%S" ) CFS tweaks.." | tee -a $LOG_FILE;
echo "NO_GENTLE_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features;
#echo "GENTLE_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features;

#echo "NO_ARCH_POWER" > /sys/kernel/debug/sched_features;
#echo "ARCH_POWER" > /sys/kernel/debug/sched_features;
# No stand_hotplug on stock JB ROM
# #echo "30" > /sys/module/stand_hotplug/parameters/load_h0;
# echo "50" > /sys/module/stand_hotplug/parameters/load_h0;
# echo "20" > /sys/module/stand_hotplug/parameters/load_l1;

# echo "2" > /sys/module/stand_hotplug/parameters/min_rq;
# #echo "30" > /sys/module/stand_hotplug/parameters/load_rq;
# echo "40" > /sys/module/stand_hotplug/parameters/load_rq;

# #echo "400" > /sys/module/stand_hotplug/parameters/rate;
# #echo "500" > /sys/module/stand_hotplug/parameters/rate;
# echo "600" > /sys/module/stand_hotplug/parameters/rate;

# Added for Jelly Bean
# Stock value 20 - loadl 50 - loadh 400 - rate
echo 20 > /sys/module/pm_hotplug/parameters/loadl
echo 70 > /sys/module/pm_hotplug/parameters/loadh
echo 400 > /sys/module/pm_hotplug/parameters/rate

#AFTR+LPA
echo "3" > /sys/module/cpuidle_exynos4/parameters/enable_mask;
#IDLE+LPA
#echo "2" > /sys/module/cpuidle_exynos4/parameters/enable_mask;
#AFTR only
#echo "1" > /sys/module/cpuidle_exynos4/parameters/enable_mask;
#IDLE only
#echo "0" > /sys/module/cpuidle_exynos4/parameters/enable_mask;

#if [ -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies ] ; then
# echo "1600 1400 1200 1000 800 500 200 100" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies;
#fi;
#

# Touch sensitivity - Default 50
echo "$( date +"%m-%d-%Y %H:%M:%S" ) Touch sensitivity tweak.." | tee -a $LOG_FILE;
echo "65" > /sys/devices/virtual/sec/sec_touchscreen/tsp_threshold
# Touchkey brightness - Default 3000mV
echo "$( date +"%m-%d-%Y %H:%M:%S" ) Touchkey brightness tweak.." | tee -a $LOG_FILE;
echo "2600" > /sys/devices/virtual/sec/sec_touchkey/touchkey_brightness

# SD Tweak
echo "$( date +"%m-%d-%Y %H:%M:%S" ) SD tweaks.." | tee -a $LOG_FILE;
READ_AHEAD_KB="4096"

if [ -e /sys/devices/virtual/bdi/1:0/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:0/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:1/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:1/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:2/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:2/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:3/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:3/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:4/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:4/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:5/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:5/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:6/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:6/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:7/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:7/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:8/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:8/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:9/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:9/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:10/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:10/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:11/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:11/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:12/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:12/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:13/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:13/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:14/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:14/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/1:15/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:15/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/7:0/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:0/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/7:1/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:1/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/7:2/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:2/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/7:3/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:3/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/7:4/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:4/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/7:5/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:5/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/7:6/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:6/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/7:7/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:7/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:0/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/179:20/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:20/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/179:40/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:40/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/179:60/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:60/read_ahead_kb
fi

if [ -e /sys/devices/virtual/bdi/default/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/default/read_ahead_kb
fi

# Memory Management
echo "$( date +"%m-%d-%Y %H:%M:%S" ) Memory management tweaks.." | tee -a $LOG_FILE;
if [ -e /sys/module/lowmemorykiller/parameters/adj ] ; then
echo "0,1,2,4,7,15" > /sys/module/lowmemorykiller/parameters/adj;
fi;
if [ -e /sys/module/lowmemorykiller/parameters/minfree ] ; then
echo "2048,4096,6144,8192,12288,16384" > /sys/module/lowmemorykiller/parameters/minfree;
fi;

# sysctl Network Tweaks
echo "$( date +"%m-%d-%Y %H:%M:%S" ) Network tweaks.." | tee -a $LOG_FILE;
sysctl -w net.ipv4.tcp_timestamps=0
sysctl -w net.ipv4.tcp_tw_reuse=1
sysctl -w net.ipv4.tcp_sack=1
sysctl -w net.ipv4.tcp_dsack=1
sysctl -w net.ipv4.tcp_tw_recycle=1
sysctl -w net.ipv4.tcp_window_scaling=1
sysctl -w net.ipv4.tcp_keepalive_probes=5
sysctl -w net.ipv4.tcp_keepalive_intvl=30
sysctl -w net.ipv4.tcp_fin_timeout=30
sysctl -w net.ipv4.tcp_moderate_rcvbuf=1
sysctl -w net.ipv4.tcp_max_syn_backlog=4096
sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1
sysctl -w net.ipv4.icmp_echo_ignore_all=1
sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1
#sysctl -w net.ipv4.tcp_syncookies=0
sysctl -w net.ipv4.ip_dynaddr=0

# Other sysctl tweaks - Kernel, VM, file system
echo "$( date +"%m-%d-%Y %H:%M:%S" ) Other tweaks.." | tee -a $LOG_FILE;
sysctl -w fs.file-max=524288
sysctl -w fs.inotify.max_queued_events=32000
sysctl -w fs.inotify.max_user_instances=256
sysctl -w fs.inotify.max_user_watches=10240
sysctl -w fs.lease-break-time=10
sysctl -w fs.nr_open=1048576
sysctl -w kernel.msgmax=65536
sysctl -w kernel.msgmni=65536
sysctl -w kernel.panic=30
sysctl -w kernel.panic_on_oops=1
sysctl -w kernel.random.read_wakeup_threshold=256
sysctl -w kernel.random.write_wakeup_threshold=256
sysctl -w kernel.sched_latency_ns=18000000
sysctl -w kernel.sched_min_granularity_ns=2000000
sysctl -w kernel.sched_wakeup_granularity_ns=3000000
sysctl -w kernel.sem="500 512000 64 2048";
sysctl -w kernel.shmmax=268435456
sysctl -w kernel.shmmni=4096
sysctl -w net.core.rmem_max=524288
sysctl -w net.core.wmem_max=524288
sysctl -w net.core.netdev_max_backlog=2500
sysctl -w net.ipv4.tcp_rmem="6144 87380 524288";
sysctl -w net.ipv4.tcp_wmem="6144 87380 524288";
sysctl -w vm.block_dump=0
sysctl -w vm.dirty_background_ratio=70
sysctl -w vm.dirty_expire_centisecs=500
sysctl -w vm.dirty_ratio=95
sysctl -w vm.dirty_writeback_centisecs=1000
sysctl -w vm.drop_caches=3
sysctl -w vm.laptop_mode=0
sysctl -w vm.min_free_kbytes=4096
sysctl -w vm.min_free_order_shift=4
sysctl -w vm.oom_kill_allocating_task=0
sysctl -w vm.overcommit_memory=1
sysctl -w vm.page-cluster=5
sysctl -w vm.panic_on_oom=0
sysctl -w vm.swappiness=30
sysctl -w vm.vfs_cache_pressure=50

# IO/Scheduler
echo "$( date +"%m-%d-%Y %H:%M:%S" ) IO Scheduler tweaks.." | tee -a $LOG_FILE;
sleep 50
if [ -f /sys/block/mmcblk0/queue/scheduler ]; then
echo "noop" > /sys/block/mmcblk0/queue/scheduler;
sleep 2
IO_SCHEDULAR=`cat /sys/block/mmcblk0/queue/scheduler`
echo "$ IO schedular set to $IO_SCHEDULAR " | tee -a $LOG_FILE;
fi;

if [ -f /sys/block/mmcblk1/queue/scheduler ]; then
echo "noop" > /sys/block/mmcblk1/queue/scheduler;
sleep 2
IO_SCHEDULAR=`cat /sys/block/mmcblk1/queue/scheduler`
echo "$ IO schedular set to $IO_SCHEDULAR " | tee -a $LOG_FILE;
fi;

if [ -f /sys/block/mmcblk0/queue/read_ahead_kb ]; then
READAHEAD_KB=`cat /sys/block/mmcblk0/queue/read_ahead_kb`
echo "$ Current read_ahead_kb is $READAHEAD_KB " | tee -a $LOG_FILE;
echo "4096" > /sys/block/mmcblk0/queue/read_ahead_kb;
READAHEAD_KB=`cat /sys/block/mmcblk0/queue/read_ahead_kb`
echo "$ read_ahead_kb set to $READAHEAD_KB " | tee -a $LOG_FILE;
fi;

if [ -f /sys/block/mmcblk1/queue/read_ahead_kb ]; then
READAHEAD_KB=`cat /sys/block/mmcblk1/queue/read_ahead_kb`
echo "$ Current read_ahead_kb is $READAHEAD_KB " | tee -a $LOG_FILE;
echo "4096" > /sys/block/mmcblk1/queue/read_ahead_kb;
READAHEAD_KB=`cat /sys/block/mmcblk1/queue/read_ahead_kb`
echo "$ read_ahead_kb set to $READAHEAD_KB " | tee -a $LOG_FILE;
fi;

echo "$( date +"%m-%d-%Y %H:%M:%S" ) 41tweaks_other ended " | tee -a $LOG_FILE;