Wednesday, February 10, 2010

Customising the HTC Hero's built in memory management tool

This guide is aimed at people who have rooted their Hero’s (guide here), and have flashed the latest (v3.2b5) version of the MoDaCo Custom ROM (guide here – you will have to seek the latest version yourselves, although I strongly suggest you sign up for MoDaCo Ad-Free which costs £9.99/year and gives you access to the “ROM Kitchen” to create your own custom ROMs).

1 ) First, mount the /system partition, you can either do this using one of the many file managers on the phone that can mount filesystems or execute the following adb command from the /tools folder of the Android SDK;

d:\AndroidSDK\tools\adb remount (your AndroidSDK path will likely be different)

2 ) Next, fire up an SSH session to your handset (I recommend using PuTTY). Username is ‘root’, the password can be found in Settings > About Phone.

3 ) Enter SU mode

# su

4 ) CD to the correct directory

# cd /system/init.d

5 ) Disable compcache

# vi compcache.sh

Press “i” to go to insert mode

Comment out the following lines (prepend with a ‘#’);

/system/xbin/insmod /system/lib/modules/ramzswap.ko disksize_kb=131072

/system/xbin/swapon /dev/block/ramzswap0

echo “10″ > /proc/sys/vm/swappiness

So you now have;

#/system/xbin/insmod /system/lib/modules/ramzswap.ko disksize_kb=131072

#/system/xbin/swapon /dev/block/ramzswap0

#echo “10″ > /proc/sys/vm/swappiness

Press ‘Esc’ then type ‘:x’ (colon then x) to exit and save the file.

6) Create your custom memory config file in init.d, you should already be there

# vi custmem

then enter the following

#!/system/bin/sh

echo “1536,3072,4096,21000,23000,25000″ > /sys/module/lowmemorykiller/parameters/minfree

Press ‘Esc” then type ‘:x’ (colon then x) to exit and save the file.

7 ) Make the custmem file executable

# chmod a+x custmem

8 ) Reboot the phone

Check the source link below for details of what each of the memory settings actually mean – the defaults in step 6 above have been proven to give the best level of performance.

If you want to try the settings before having them used permanently, simply (from PuTTY or by using adb shell) type;

echo “1536,3072,4096,21000,23000,25000″ > /sys/module/lowmemorykiller/parameters/minfree

Source.





[Via http://djbenson.wordpress.com]

No comments:

Post a Comment