[Android Software/Hacking General [Developers Only]] rahulsa:
Custom methods with S2E for performance and space.

To start with, this is what I have.

CM 7.2 stable installed on Idea ZTE Blade with 256 MB RAM, with now 16 GB class 6 SD card. SD card has 1 GB ext4, 256 MB swap and rest fat32.

Blade checker reports Cinese Blade (256MB RAM), Gen 2.

Partition layout is stock i.e. system 220MB, data 162 MB, cache 37MB.

Blade checker does not show the size of OEM partition, probably its 20 MB.

S2E installed with all apps moved to /sd-ext, then rebooted.

S2E does not support enabling swap.

Swap can perhaps be useful for many phones with just 256 MB RAM.

Also have Titanium Backup Pro installed.

This is a must I would say.

Before doing this disable m2sd everything.

To remove (un-install) Mount2SD script I simply deleted 10mounts2sd script from \system\etc\init.d\ folder.

Using TB Pro converted all important gapps to system apps.

These are Gmail, Google Play, You Tube, Maps and even Go SMS Pro.

This moved those apps to /system from /data. So performance is same and lot of space is freed. Later on integrated the updates of ROM Manager, G.Play into ROM, freeing up space in /data.

Using TB Pro integrated sys dalvik into ROM which freed up about 37 MB of space in /data.

Using TB Pro moved data of Facebook and Google + to SD card, using "Move app data to SD card" feature.

This actually moved the com.facebook.katana folder inside /data/data to /sd-ext/data2 location and created a symbolic link in /data/data.

And same for Google +.

But with Facebook app slowed a bit. So moved com.facebook.katana from /sd-ext/data2 to /cache/data2. Note I created /cache/data2 folder first.

Deleted original symlink and created new one.

Now in order to maintain "/cache/download" space requirement I moved it to "/sd-ext/download" using S2E.

Also to enable swap and some mounting optimizations, I added following lines to 20userinit script present in /etc/init.d folder.

mount -o remount,noatime,nodiratime,relatime,barrier=0,nobh /system

mount -o remount,noatime,nodiratime,relatime /data

swapon /dev/block/mmcblk0p3

Please note that /dev/block/mmvblk0p3 is third primary partition on external SD card, in my case. You can check it in folder /dev/block if it is different in your case. The partition is of type Linux swap (83).

To edit 20userinit script you have to first mount /system partition as read & write. Use following commands on command prompt of "Terminal Emulator" app.

su

mount -o rw,remount /system

cd /etc/init.d (or cd /system/etc/init.d )

vi 20userinit

cd /etc

vi sysctl.conf

And insert following line. ( You may change value from 0 to 100)

(0=dont swap, 100= always swap)

vm.swappiness=50

Default should be 60 on Linux and Android.

But with m2sd installed and swap enabled I found out that swappiness was 30.

You can find out default (current) value by typing following.

cat /proc/sys/vm/swappiness

With all this my phone is fast and switching between application is quick.

With many apps simultaneously open, occasionally phone ringing starts but does not quickly show up receive screen or callers photo.

This is mainly due to swapping and low memory.

It will not happen on phones with 512MB RAM.

Click on thanks button, if I helped you !