[EDIT] I posted this a while back -- I am not sure how all this works with newer versions [\EDIT]
Creating this as a separate thread to discuss all things compcache/swap.
EDIT: This might only work with Cyan's ROM's -- I don't really know
you are welcome to try with other ROM's though -- and if ya do -- let us know how it goes!
I'm just going to start by detailing how I got setup with compcache with backing swap. (the second post will tell why you want to use backing-swap instead of linux swap)
EDIT: Though you may decide you don't want to use either, and just want vanilla compcache -- if that is the case -- and you don't already have compcache setup you can still follow the instructions below, and just ignore the parts that tell you, you have to have a linux swap partition, and that you should edit the files)
(also -- regardless of how you set it up -- once you have compcache setup - you can use the intructions in post three -- to try tweaking settings like swapiness, if you are so inclined)
(Also -- see the third post for instructions on what to do if you are already set up, and just want to tweek some values)
To save time -- I am going to steal from previous posts. (many thanks to SilleeString, as I stole much from his posts
)
If anyone has suggestions for updates/corrections/clarifications -- feel free to PM me and I will do my best to include them -- Though I am going to be a bit busy this weekend
Here we go....
So to get setup with backing swap first you need to have a swap partition on your SD card. If you are sure you already have a linux-swap partition on sdcard (in addition to ext3 partition) -- or if you just want compcache with no backing_swap -- skip this paragraph
I have cooked up a method to repartition your SD card and not loose anything -- I have made a separate post detailing the method -- it can be found here (this will backup and restore your ext3 partition/apps too!)
http://androidcommunity.com/forums/232988-post31.html
OK -- so at this point you should have a linux-swap partition, on your SD card (unless you are just trying to setup compcache without backingswap or linuxswap)
First - Download the newest version of userinit.sh found here
http://forum.xda-developers.com/showthread.php?t=542899
Unzip the files on your sdcard and edit "user.conf" looking for and editing the following 3 variable assignments
NOTE: if you edit user.conf you must use a linux friendly editor(i.e. notepad/wordpad are not linux freindly) -- if you dont have one -- see below for a work around -- and for now -- just use wordpad to open, and edit the files.
Here is how to use wordpad to open and edit the files
Open wordpad from the start menu under Accesories
then File --> Open
In the open file dialog browse to the folder with the files
Then near the bottom of the open file dialog box -- find the "Files of Type" dropdown box -- select "All Documents (*.*)" and you should be able to see the files now
Open the files, edit them as instructed below, and click save
Variables to look for and set/edit.... (assuming you are trying to setup backing_swap)
Code:
cc_backingswap_en=1
cc_disksize=0
cc_memlimit=8
and make sure (linux_swap_en=0)
(The above variable set, is to setup compcache with backing_swap -- See the bottom of post 3, for more different sets of variables you can try for different configs)
then type the following into terminal:
Code:
su
mount -o remount,rw /dev/block/mtdblock3 /system
WORKAROUND: If you did not use a linux friendly editor to user.conf, (i.e. notepad/wordpad are not linux freindly) you must run the following command at this point....
Code:
dos2unix /sdcard/user.conf
This converts user.conf to linux format from the format notepad/wordpad saves them in in windows.
Now we need to copy the files from the sdcard to where they need to go. So do the following in terminal
Code:
cp /sdcard/userinit.sh /system/sd
cp /sdcard/user.conf /system/sd
IF THIS IS THE VERY FIRST TIME YOU EVER SETUP COMPCACHE -- THEN SKIP THIS PARAGRAPH
If you already had compcache enabled -- and are just trying to add backing swap -- then all you need to do is reboot your phone now, and run the following to verify (you should see something about "backingswap" near the top)
Code:
rzscontrol /dev/block/ramzswap0 -s
The rest of the instructions below, only need to be done, if you are setting up compcache for the first time 
START BACK HERE IF YOU HAVE NEVER SETUP COMPCACHE BEFORE
Here's how to enable it:
Code:
modprobe ramzswap
rzscontrol /dev/block/ramzswap0 --init
swapon /dev/block/ramzswap0
Might be good to reboot the phone here.
To get stats:
Code:
rzscontrol /dev/block/ramzswap0 -s
Bookmarks