[HD2 Android NAND Development] dorimanx:
Compcache or Swap missing in ROM

Hi,

I am using this rom long time now and i have recently noticed that there is no compcache libs or config in this rom.

So no metter if we set compcache to 26% it's not working!

it's just empty setting!

And no SWAP for more memory.

I have lots of apps that i use, and they eat my ram so i have left with 20mb free

Now in this case ram killer start to kick apps from RAM.

The annoying part is that it's kick the launcherpro many times and i need to wait until it's load up again.

all the rest is not big deal.

So i have searched the forum and gathered some good info and tweaks.

I still didn't used the compcache libs and config to activate it, but i have some good things that i like to share.

1.

to activate swap to help with low memory problem i have used this:

Backed up my phone with titanium backup pro!

Backed up my SD card to my drive! VERY IMPORTANT STEP!!!!

(if you skip it you will lose all your data!)

Install Recovery_140M_system_5M_cache[v3.1.0.1]

search for it download, unpack edit the flash.cfg and pack it back to zip.

I have changed the flash.cfg

misc ya 1M
recovery rrecov|ro|nospr filesize recovery-raw.img
boot yboot|ro 5M
system ya 150M
cache ya 10M
userdata ya|asize|hr allsize

So now it's 150mb with 10mb cache.

entered recovery console --> advanced --> partition sdcard

choose 1gb and 256mb SWAP! (only found that in v3.1.0.1)

When finished my sdcard was erased!. all of it!!!

took it out from phone and copied all my stuff back from my drive.

Including the ROM (in zip)

Installed rom via recovery and booted.

waited for 10 minutes to let it work.

Rebooted normally.

Now the fun part. :)

created file with notepad that contain this!

mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mkswap /dev/block/mmcblk0p3
echo "swapon -a" >> /system/etc/init.d/94swap
echo "echo '80' > /proc/sys/vm/swappiness" >> /system/etc/init.d/94swap
cd /etc/init.d/
chmod 750 94swap
chown root:shell 94swap
echo "/dev/block/mmcblk0p3 swap swap" >> /system/etc/fstab

named it swapon

copied to my sdcard root /.

now using terminal type :

su -

free

(this will show you your mem and that there is no swap at all)

cd /sdcard

chmod 755 swapon

./swapon

"now you have the swap configured!"

reboot

=============

after reboot go back to terminal and:

su -

free

(you should see your free mem + swap 256mb :) )

Now your phone will work way better.

But as i searched i have found that people say, swap can damage you sdcard in long time term. (long long time)

but i think it's will not happen because phone will use swap only on really low memory situation!

Tweak 2:

How to make home app stay in ram and reduce refresh of all icons and widgets.

use root explorer to go to /system dir.

check that you have RW partition, not RO

open with text editor file build.prop

find line with dalvik.vm.heapsize=32m

and delete it.

Now put this in the file.

dalvik.vm.heapstartsize=5m
dalvik.vm.heapgrowthlimit=48m
dalvik.vm.heapsize=128m
ro.HOME_APP_ADJ=-17
ro.HOME_APP_MEM=256
dalvik.vm.dexopt-data-only=1

save and reboot.

This will tell to system to use more virtual ram for big apps

and not to kill home app, -17 is the background service (system only stuff dont f*k*n touch it :-) )

Here is one more!

Very good thing!!!!

this is my voltage script

#!/system/bin/sh
# set vdd_levels on boot by tyween (XDA Developers)
echo '245000 925' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '384000 925' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '422400 925' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '460800 925' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '499200 950' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '537600 950' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '576000 1025' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '614400 1050' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '652800 1075' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '691200 1100' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '729600 1100' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '768000 1100' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '806400 1150' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '844800 1175' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '883200 1175' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '921600 1200' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '960000 1225' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '998400 1225' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '1036800 1275' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '1075200 1275' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '1113600 1300' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '1152000 1350' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '1190400 1375' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels

i have tested it long time!

under stress and in sleep mode

it's saves battery and make the phone fast when needed!

Just one thing that i have found that you need to consider!!!

When overclocked up to 1190400 and charger connected or usb

Phone may freeze!!!

So

I have installed SetCPU and created profile that say:

When phone charging use from 256 to 1152000 only!

And no problem since then :)

If any one want more tweaks that i am using via apps that make the changes for me i will name them in private.

They are paid apps

free in most cases are useless.

Hope we will get compcache in new updates!

it's will really help to use more apps in memory.

and who will like to have more speed just disable it in settings -> cyanogenmod --> performance -- compcache

thanks.