Quote:
Originally Posted by InvincibleLiving
Hey Tiger, I want to know more about the swapfile you referenced, can you share? TIA
|
Yeah, I've got it by create a swapfile at /sdcard/swapfile by `dd` command on the my Linux box:
Code:
dd if=/dev/zero of=$HOME/swapfile bs=1M count=64
and then make Swap FS with that file
Code:
mkswap -f $HOME/swapfile
Then modified froyo.user.conf to look like this:
Code:
# custom shell commands, these commands run last
custom_shells{
chmod 777 /etc/dbus.conf
echo "Remove dirty files"
rm /sdcard/FSCK*.REC
rm /sdcard/fsck*.rec
echo "Copy hosts to remove ad"
cp -fv /sdcard/tools/etc/hosts /data/etc/hosts
cp -fv /sdcard/tools/etc/hosts /system/etc/hosts
echo "Mounting external mods."
mount --bind /sdcard/mods/libGLES_qcom.so.11.29.10 /system/lib/egl/libGLES_qcom.so
mount --bind /sdcard/mods/gralloc.msm7k.so /system/lib/hw/gralloc.msm7k.so
mount --bind /sdcard/mods/build.prop /system/build.prop
echo "Mounting swapfile on /sdcard/swapfile"
swapon /sdcard/swapfile
}
I was move all the test drivers to /sdcard/mods to get more clean look at root of my sdcard, also I have done with some tricks to remove some dirty files generated while fsck is run, mapped hosts file to remove ad from application...
Also, I was modified block "swap_file" to look like this:
Code:
#create swap file for compcache or linux swap
swap_file{
swap_file_en=1 # set to 1 to create swap file
# set to 0 to del the swap file
linux_swap_file_size=64 # swap file size in MB
linux_swap_file=/sdcard/swapfile # pointing to the swap file location ( must be /system/sd/)
}
But seen its look not make any sense and kernel not go to use swap, just ignore it.
This is block I was modified to make kernel using more swap when more applications running to give more ram for focusing activity:
Code:
#virtual memory
sys_vm{
sys_vm_en=1 # enable(1) or disable(0) virtual memory configurations
swappiness=20 # default 60
page_cluster=0 # default 3, (0 since CM3.9.6+)
laptop_mode=5 # default 0
dirty_expire_centisecs=3000 # default 3000
dirty_writeback_centisecs=1500 # default 500
dirty_background_ratio=3 # default 5
dirty_ratio=5 # default 10
vfs_cache_pressure=200 # default 100 (tendency of the kernel to reclaim cache memory)
overcommit_memory=1 # default 0 (0=Heuristic 1=Always overcommit 2=Don't overcommit)
overcommit_ratio=80 # default 50 (% of Physical+Virtual memory to allow allocation)
}
That is what's I've done. I have attach my froyo.user.conf and swapfile as you need to make it. (Good for M$'s user which not have dd tool already :P )