First things first I assume you have already the latest version of miniCM7 and nAa kernel, although this mini howto should apply for any phone and any rom out there, as long as the kernel supports swap partition.
First thing you want to partition your SD card in order to create our swap partition, I recommend you to follow this accurately.
Now that we have successfully created our swap partition, we want to boot up the phone and enable our swap partition in order to be accessible to the kernel.
To detect the swap partition that we have just created open up a ADB terminal and type
fdisk -l dev/block/mmcblk0
/dev/block/mmcblk0p3 862 966 843412+ 82 Linux swap
We can now check if our swap partition has been activated by executing the command free
Now we want to make our swap partition to be activated at boot time, without having to activate it manually everytime we reboot the phone.
Assuming you know how to at least write and save a text file in VI, let's go back to our fido ADB shell and type
#!/system/bin/sh #Swap swapon /dev/block/mmcblk0pX
If you are not really comfortable with VI you can also use Nano or even RootExploer or any other root file manager if you are more comfortable with UI.
save it and once again in ADB shell lets make it executable
chmod a+x /data/local/userinit.sh
Temporary change (until next reboot)
echo 60 > /proc/sys/vm/swappiness
echo vm.swappiness=60 >> /system/etc/sysctl.conf
~ # free total used free shared buffers Mem: 186704 177248 9456 0 116 -/+ buffers: 177132 9572 Swap: 843404 53760 789644
** few notes **
I don't intend to take credit for this how-to as it takes few pieces of commands and hints from any guides out there which covers this topic, and anyways its basic linux knowledge really..
So cheers you all and enjoy