Cara Swap Memory di WM8650 / IMO X3 (How To Swap Memory in WM8650)

IN ENGLISH

Run Terminal Emulator for Android (I recomend use new version)

First, create a swap space. Open Terminal and start typing...

Code: [Select]

$ su
# dd if=/dev/zero of=/data/swapfile bs=1M count=512
# chmod 600 /data/swapfile

What does it do? The first line makes you a superuser ("root"). The second line creates a 512MB file full of zeroes. Feel free to substitute 512 for whatever you like. The third line is just for security. It limits who can fiddle with the file. You can leave it out if you wish. Please note that creating such a large file may take a while. Depending on how slow your NAND is, dd may take up to 10 minutes. Be patient.

The next step is making sure the swap space can be used. Remember what I said about yaffs2? We need to go about it in a roundabout way...

Code: [Select]

# losetup /dev/block/loop1 /data/swapfile
# echo $?

The first line makes the file /data/swapfile a "loopback" device, basically as if a new partition. It can be formatted to whatever file system you like and mounted. The second line just checks the result. If it prints anything other than 0 (zero), try loop2, loop3 etc, or hit Mr Google.

Nearly there, just a few finishing touches...

Code: [Select]

# mkswap /dev/block/loop1
# swapon /dev/block/loop1
# free

The first line "formats" the loopback device as swap and the second line turns it on. Job done. The third line is just to check it worked; it prints memory statistics including any swap space, if available.

Hurray! We've done it! Well, not quite yet I'm afraid. Some of the changes are not persistent. In particular, losetup and swapon need to be repeated on each reboot. There are a few ways of how to achieve that. I chose this one:

Code: [Select]

# echo losetup /dev/block/loop1 /data/swapfile >>/etc/init.sh
# echo swapon /dev/block/loop1 >>/etc/init.sh



Credit for: pichlo(techknow.t0xic.nl)




INDONESIA VERSION

Pertama buka terminal, download di Play Store or Android Market...

ketik

$ su
# dd if=/dev/zero of=/data/swapfile bs=1M count=512
# chmod 600 /data/swapfile

count=512 bisa di ganti sesuai selera kalo ane make 256

# losetup /dev/block/loop1 /data/swapfile
# echo $?

/data/swapfile bisa diganti ke sdcard tp saran ane sih mending make yg internal aja supaya

klo ganti sdcard ga ribet nyetingnya kembali...

# mkswap /dev/block/loop1
# swapon /dev/block/loop1
# free

klo sdh jadi tinggal dimasukkin ke script init.sh yg ada di /etc

ketik

# echo losetup /dev/block/loop1 /data/swapfile >>/etc/init.sh
# echo swapon /dev/block/loop1 >>/etc/init.sh

nah sekarang sudah selesai semua tinggal setting 2 baris untuk mematikan

/sys/module/lowmemorykiller/parameters/adj dan

/sys/module/lowmemorykiller/parameters/minfree

ketik

echo 0 > /sys/module/lowmemorykiller/parameters/adj
echo 0 > /sys/module/lowmemorykiller/parameters/minfree

lalu ketik free... sekarang swap sudah bisa dipakai..

inget masukkin script di atas ke init.sh menggunakan teks editor supaya kalau dihidupkan

kembali kita tidak perlu setting buat matiin tuh adj sama minfree..


credit to : agan lukas1720 (kaskus.co.id)

Categories: Share

Leave a Reply