If your'e like me and don't need one more program taking up space on your phone you can enable RAM swap through any terminal manager.
The following method will create a swapfile on your SD card...I use the SD card instead of /data because RAM swapping will increase the number of read/writes wherever the swapfile is located and I would rather have to replace my SD card than have my NAND go out IF you want to use your internal memory you can replace /mnt/sdcard/ with /data/...
What you need:
Root
Busy Box (I use 1.19)
Terminal Manager (I use Smanager)
Kernel capable of swapping (I'm using glitch)
Open your terminal manager and enable SU if needed
To create your swapfile
X is the size of your swapfile in MB...should only take a couple minutes.
Now that you've got the swapfile on your SD we've got to turn it on
Ta-DA! you now have an active ram swap type "free" and you should see your active swap...but we're not done yet. Still have to enable it at boot
Go to /etc/init.d/ and create file 99swapon (or whatever you want to name it) edit the file and type
Depending on how fast your phone mounts your SD card you can reduce the sleep value to as low as 30.
Reboot...open terminal...type free and you should see your swap listed.
The default "swappiness" for android is 60 you can check this by typing
To change this go to /etc/ and create a file named sysctl.conf edit the file and type
X is the level of swappiness and can be 0 - 100...the higher the number the more android uses swap. In your terminal type
Output should show your new swappiness level...again to check this "cat /proc/sys/vm/swappiness" In order to have these settings applied at boot edit your 99swapon file and add
Reboot...open terminal...type free to check swap is on...type cat /proc/sys/vm/swappiness to check your swappiness level.
For those of you who don't want to actually have to type out all of that here are some scripts I wrote up to automate it all...made a 32M and 64M version for /mnt/sdcard and /data.
Make Swapfile
http://dl.dropbox.com/u/101517904/32m_swapfile_data.sh
http://dl.dropbox.com/u/101517904/32m_swapfile_sdcard.sh
http://dl.dropbox.com/u/101517904/64m_swapfile_data.sh
http://dl.dropbox.com/u/101517904/64m_swapfile_sdcard.sh
Activate Swap, Set Swappiness and Set at Boot
http://dl.dropbox.com/u/101517904/data_swapon_boot.sh
http://dl.dropbox.com/u/101517904/SD_swapon_boot.sh
Enjoy!!
A brief note on swapping - This does not actually extend you RAM...Android swapping only moves mapped in-active apps from memory to swapfile. To put it in simple terms bigger is not better...so create yourself a nice little 32M or 64M swapfile and set your swappiness to 100. Also minfree does not account for swap so you can get by with lower minfree values if you're using V6 supercharger.
The following method will create a swapfile on your SD card...I use the SD card instead of /data because RAM swapping will increase the number of read/writes wherever the swapfile is located and I would rather have to replace my SD card than have my NAND go out IF you want to use your internal memory you can replace /mnt/sdcard/ with /data/...
What you need:
Root
Busy Box (I use 1.19)
Terminal Manager (I use Smanager)
Kernel capable of swapping (I'm using glitch)
Open your terminal manager and enable SU if needed
To create your swapfile
Code:
# dd if=/dev/zero of=/mnt/sdcard/swapfile bs=1048576 count=X
X is the size of your swapfile in MB...should only take a couple minutes.
Now that you've got the swapfile on your SD we've got to turn it on
Code:
# mkswap /mnt/sdcard/swapfile
# swapon /mnt/sdcard/swapfile
Ta-DA! you now have an active ram swap type "free" and you should see your active swap...but we're not done yet. Still have to enable it at boot
Go to /etc/init.d/ and create file 99swapon (or whatever you want to name it) edit the file and type
Code:
#!/system/bin/sh
sleep 75
swapon /mnt/sdcard/swapfile
Depending on how fast your phone mounts your SD card you can reduce the sleep value to as low as 30.
Reboot...open terminal...type free and you should see your swap listed.
The default "swappiness" for android is 60 you can check this by typing
Code:
cat /proc/sys/vm/swappiness
To change this go to /etc/ and create a file named sysctl.conf edit the file and type
Code:
vm.swappiness=X
X is the level of swappiness and can be 0 - 100...the higher the number the more android uses swap. In your terminal type
Code:
sysctl -p
Output should show your new swappiness level...again to check this "cat /proc/sys/vm/swappiness" In order to have these settings applied at boot edit your 99swapon file and add
Code:
sysctl -p
Reboot...open terminal...type free to check swap is on...type cat /proc/sys/vm/swappiness to check your swappiness level.
For those of you who don't want to actually have to type out all of that here are some scripts I wrote up to automate it all...made a 32M and 64M version for /mnt/sdcard and /data.
Make Swapfile
http://dl.dropbox.com/u/101517904/32m_swapfile_data.sh
http://dl.dropbox.com/u/101517904/32m_swapfile_sdcard.sh
http://dl.dropbox.com/u/101517904/64m_swapfile_data.sh
http://dl.dropbox.com/u/101517904/64m_swapfile_sdcard.sh
Activate Swap, Set Swappiness and Set at Boot
http://dl.dropbox.com/u/101517904/data_swapon_boot.sh
http://dl.dropbox.com/u/101517904/SD_swapon_boot.sh
Enjoy!!
A brief note on swapping - This does not actually extend you RAM...Android swapping only moves mapped in-active apps from memory to swapfile. To put it in simple terms bigger is not better...so create yourself a nice little 32M or 64M swapfile and set your swappiness to 100. Also minfree does not account for swap so you can get by with lower minfree values if you're using V6 supercharger.