Android: Adding swap space


I own a G1, the first generation Android mobile phone and have rooted it when I returned back to Mauritius because that meant that I would not be receiving OTA updates anymore 🙁 With root comes great power.. I guess..

Well if you have rooted your Android and wish to add some swap space to it, *will make it a little faster, will handle more applications running at the same time* .. with the warning sign *will shorten the life span of your SD card*, here it goes:

This will add 100Mbytes of swap space on your android where count=100*1024

Open up a terminal on your Android:

su –

dd if=/dev/zero of=/sdcard/swap bs=1024 count=102400

Your android will process this for 30-60seconds and you should get something like:

102400+0 records in

102400+0 records out

104857600 bytes (100.0MB) copied, 18.829346 seconds, 5.3MB/s

Then proceed with the following:

mkswap /sdcard/swap

Output: Setting up swapspace version 1, size= 104853504 bytes

swapon /sdcard/swap

free                                     #to check if mounted

Please note that you will have to run swapon /sdcard/swap everytime you reboot your phone if you wish to use the swap space.

Gulshan Yashveer Beejan

Gulshan holds a BSc(Hons) Computer Science with Distributed systems from the City University of London. He is currently working at DSOGroup(Mauritius) as a Linux Administrator on SaaS Solutions. More about Gulshan

Leave a Reply

Your email address will not be published. Required fields are marked *