Is your phone running slowly? Can't run apps properly? Check out my swap tutorial.

The original poster: Childish and dreamy Views: 653 Replies: 7 Posted in: 2013-08-17 19:14:38
(coin=10000) Actually, this kind of tutorial is everywhere. Given the request from a certain forum user, I'll just casually write a tutorial, after all, what I write still has some differences compared to others. Swap is the virtual memory in Linux systems, serving the same purpose as Windows virtual memory—to expand RAM. Those who have used computers with 256M or 512M of RAM probably know very well what virtual memory is {:125_449:}. Enabling swap can make up for insufficient RAM; in theory, it allows more programs to run simultaneously. Swap is the use of a portion of the SD card or internal storage to perform the functions of RAM. However, the read/write speed of swap is far slower than RAM, so enabling swap does not necessarily improve your phone's performance. Sometimes enabling it can even make your phone slower, so swap is not as great as some people think. Since I personally find that enabling swap sometimes makes my phone very laggy when there is low memory, I recently gave up on swap. Because I strictly control the programs resident in memory, I find it sufficient not to use swap, and the home screen does not reload. Conditions: 1. Have an SD card and card reader (not required, see step 4) 2. Root access 3. Phone Bootloader unlocked 4. Kernel that supports swap I. Partitioning http://bbs.gfan.com/android-2721739-1-1.html Still referencing Xiao Su. If you've partitioned before, you can skip this step. If you haven't, follow the tutorial to properly create a swap partition; nothing else needs to be touched (if interested, you can also partition ext). II. Flashing the kernel http://bbs.gfan.com/android-3553112-1-1.html fastboot tutorial Note: rename the kernel I uploaded as boot.img and place it in the fastboot directory. There are two 2.3.4 kernels and one 2.3.3 kernel; flash the corresponding version. Those who know how to flash can ignore the tutorial. Additionally, here is a small tool to help beginners http://bbs.gfan.com/android-3885802-1-1.html III. Enabling swap When following Xiao Su's tutorial, you might have noticed the software 'swapper'. It can indeed enable swap on a partition, but it cannot adjust the swap-in rate (swapinness). Since the kernel supports custom scripts, we use a script to enable swap, which avoids installing extra software and reduces memory usage. We just need to place the '06swaponSD' script in the /etc/init.d directory and restart the phone to enable swap. But how can we tell if swap has been enabled?As shown in the picture: Install this meninfo, click "show swaps", and check whether numbers appear in the red box to know if it's enabled. The number in front is the total swap, and the number behind is the used amount.

4. swap2cache This is another way to enable swap. Literally, it means enabling swap on the cache partition. Since the cache is internal storage, swap2cache does not require an SD partition. swap2cache creates a swap file on the cache partition, while swaponSD directly uses the swap partition on the SD card, so there may be some performance difference between the two methods, though it might not be significant. You can choose according to your needs. swap2cache is very simple to implement; there's no need for partitioning. After flashing the kernel, just put the "05swap2cache" script into the /etc/init.d directory and restart the phone.

Here are the sources of the kernels, if you're interested, you can check them out:
http://forum.xda-developers.com/showthread.php?t=1468043 NightElf Kernel
http://forum.xda-developers.com/showthread.php?t=1316259 Inteks Kernel
http://forum.xda-developers.com/showthread.php?t=1197263 DoomKernel

Inteks Kernel is stable and functional; NightElf Kernel has slightly more features and is fresher, such as GPU overclocking and adding 10MB of RAM, but is relatively less stable; DoomKernel was used for 2.3.3, is quite old, and the author no longer develops kernels for the Neo.

For details, see the forum post: bbs.gfan.com/forum.php?mod=viewthread&tid=3974833&extra=&page=1&mobile=yes&simpletype=yes&t=14846(/coin)
reply 🤍 0 📤 share collect
OP, thank you for your hard work
Hmm~ how about changing the name to 'Cute but also Mature'
Ha, failed to rip off money.
If possible, it really needs support.
Just passing by, supporting
Indicates liking the current name of the original poster
Hehe, thanks a lot
— All replies loaded —

Leave a Reply