Swapper [Root Users] Reduce Lag and Save Ram

Search This thread

Patambiz

Senior Member
Jul 29, 2012
422
305
Legazpi
So what is Swap?

A swap file allows an operating system to use hard disk space to simulate extra memory. When the system runs low on memory, it swaps a section of RAM that an idle program is using onto the hard disk to free up memory for other programs. Then when you go back to the swapped out program, it changes places with another program in RAM. This causes a large amount of hard disk reading and writing that slows down your computer considerably.

I can say Swap file is like Virtual Memory on your PC.

New Info:
For those who struggle with the Free on terminal Emulator, the swapper will still work. Here is the simple Instruction. Just make as 100-128mb Swap then put it to 50 swappines, reboot and done.

The Swapper can Work on Many Devices. I tested it on Neo V, Arc S and Samsung Galaxy SII
Just to make sure it supports this kind of Feature. Free to try it, its harmless.
Requirements:
-Any Rom- (Tested on Acronium 4 and I-Scream)
-Custom Kernel- (Tested on KGT and Xarc Kernel)
-300+ sdcard space-
-Terminal Emulator-
Source: Google Play
or Attached File

Start:
Download the Swapper2 and install.

Click Here

2. Go to terminal emulator type "Free" without the Quotation.
Make sure you see "0" on the Swap

Screenshot_2012-08-08-09-42-38.png


3. open swapper2 go to Setting, Swap size=32 MB, Swappiness=60. (You can Play on the numbers you want I just displayed a Default Swap Settings.)
Go Advanced preferences check "Recreate swap file" and "Reformat swap" then exit...

Screenshot_2012-08-08-09-43-39.png


4. Open Swapper2 click ON it will show some Fail.
Just wait for few secs or mins and it will continue. If not, Click the ON again.

Screenshot_2012-08-08-09-44-10.png


5. Go to terminal emulator type free and you will see that the "0" has been replaced.

Screenshot_2012-08-08-09-44-23.png


Screenshot_2012-08-08-09-45-19.png


Hit thanks if you think I helped.

Note:
This just give Everyone Idea that Swapfile is working without Partitioning your SD cards.
 
Last edited:

Patambiz

Senior Member
Jul 29, 2012
422
305
Legazpi
Reserved

Notes:
Risk Free..
Enable/Disable Swap
Safe SD Card
Free to experiment what Numbers is suitable on your Settings.
The swap file Works well when your system Ram went low that can help Handling Running Process and Multitasking.

---
Update.. 0.1
---
For those who cannot do the do the Swap due to Kernel Issue
Here is a new way without using the Swapper 2

SOLUTION: How to make simple ZRAM init.d script



1. Using Root Explorer, got to /sytem/etc/init.d/
2. press Menu then create new file
3. paste these in it
Code:

#!/system/bin/sh
sysctl -w vm.swappiness=60
echo '1' > /sys/block/zram0/reset
echo $((60*1024*1024)) > /sys/block/zram0/disksize
mkswap /dev/block/zram0
swapon /dev/block/zram0

4. close and save it as 99zram
5. set permission to 777 or "rwxrwxrwx" (tick all)
6. take note: 60*1024*1024 = 60MB zram disksize. if you want to set 30MB, change 60 to 30.

Thanks.

I will be Unavailable for a Moment. Im creating my own Custom Kernel
logo.rle_.png
 
Last edited:

XTCrefugee

Senior Member
Jun 23, 2006
244
32
Unfortunately, this doesn't work on the stock kernel as we don't have the ramzswap module. But as I mentioned here it looks like it could be compiled as a loadable module if someone was willing to do it. Any takers?
 
  • Like
Reactions: D2m_mhd

Patambiz

Senior Member
Jul 29, 2012
422
305
Legazpi
Unfortunately, this doesn't work on the stock kernel as we don't have the ramzswap module. But as I mentioned here it looks like it could be compiled as a loadable module if someone was willing to do it. Any takers?

Yes, I used Xarc kernel. Somehow It doesn't work with other kernel. They can use the zram instead.
 

n3n00

Senior Member
Dec 7, 2010
1,561
258
Split
I would love this but I'm on stock kernel. Can I use module from other thread or is anyone able to make loadable module?

How does your "Running services" look after swap? (edit: oh I can see in your signature... nice :) I want this on stock kernellll :S)
 
Last edited:

wth_is_life

Senior Member
Mar 27, 2012
660
74
Will it work on ArcKnight ? :D

This causes a large amount of hard disk reading and writing that slows down your computer considerably.

Umm can you explain it more, since if it slows down... ?

I've learned that this may harm SD card, is it true ?
 
Last edited:

panicc.co

Senior Member
Jul 16, 2011
159
43
On stock 4.1.b I have access to swap in emulator. The file gets created permissions get set. Formating works. Everthing except the start command swapon works. Just thought I'd share what was happening on stock lt15i so we can hopefully get this running on stock to help us lck BL people lol.

Thx for the idea. Seems better than supercharge.

Sent from my LT15i using xda app-developers app
 
Last edited:

KradEdis

Senior Member
Sep 26, 2010
143
13
53
Seixal
Yes, I used Xarc kernel. Somehow It doesn't work with other kernel. They can use the zram instead.

In the OP you say that it was tested on ICS stock... :)

I'm on ICS stock and I noticed a lag reduction and a lower working temperature when multitasking is taking place

A placebo effect??

I used another app and get this file.

5d6c6be3-e6d7-d9be.jpg


Sent from my LT18i using Tapatalk 2
 
Last edited:

Patambiz

Senior Member
Jul 29, 2012
422
305
Legazpi
In the OP you say that it was tested on ICS stock... :)

I'm on ICS stock and I noticed a lag reduction and a lower working temperature when multitasking is taking place

A placebo effect??

I used another app and get this file.

5d6c6be3-e6d7-d9be.jpg


Sent from my LT18i using Tapatalk 2

Great.. What app you use instead?
 

Patambiz

Senior Member
Jul 29, 2012
422
305
Legazpi
Will it work on ArcKnight ? :D



Umm can you explain it more, since if it slows down... ?

I've learned that this may harm SD card, is it true ?

I haven't tested it on Arc Knight. No it will not harm your SD card. its just make file image. Im having this on my 16gb sd card and having no problem. SD class also matter for performance.
 

KradEdis

Senior Member
Sep 26, 2010
143
13
53
Seixal
Great.. What app you use instead?

Although it creates the script, the fact that the stock kernel is swap locked doesn't allow that same script to run.

I got this report...

4e89dcbe-cae6-3f23.jpg


But I must say that it was quite odd seeing this cause during the time I had the app installed onbthe phone it lagged alot less and the usual high temperature reached when playing a game or browsing the internet didn't occur.
A true mistery... :confused:

Oh... I used Swapper for root.

Sent from my LT18i using Tapatalk 2
 
Last edited:

XTCrefugee

Senior Member
Jun 23, 2006
244
32
Ok for those who have Zram Enabled on their Kernel. I have updated the thread at 2nd post with the zram swap.

The stock kernel doesn't have zram either. Nor of course is zram a 'real' swapfile, it's just a compressed area of ram.

Unless you want this thread to be full of posts just saying "swapon doesn't work" or "function not implemented", if I were you I'd change the text of your first post to say that this is only for devices with unlocked bootloaders using custom kernels.
 

KradEdis

Senior Member
Sep 26, 2010
143
13
53
Seixal
The stock kernel doesn't have zram either. Nor of course is zram a 'real' swapfile, it's just a compressed area of ram.

Unless you want this thread to be full of posts just saying "swapon doesn't work" or "function not implemented", if I were you I'd change the text of your first post to say that this is only for devices with unlocked bootloaders using custom kernels.

Thank you for answering me.

Sent from my LT18i using Tapatalk 2
 

Top Liked Posts

  • There are no posts matching your filters.
  • 67
    So what is Swap?

    A swap file allows an operating system to use hard disk space to simulate extra memory. When the system runs low on memory, it swaps a section of RAM that an idle program is using onto the hard disk to free up memory for other programs. Then when you go back to the swapped out program, it changes places with another program in RAM. This causes a large amount of hard disk reading and writing that slows down your computer considerably.

    I can say Swap file is like Virtual Memory on your PC.

    New Info:
    For those who struggle with the Free on terminal Emulator, the swapper will still work. Here is the simple Instruction. Just make as 100-128mb Swap then put it to 50 swappines, reboot and done.

    The Swapper can Work on Many Devices. I tested it on Neo V, Arc S and Samsung Galaxy SII
    Just to make sure it supports this kind of Feature. Free to try it, its harmless.
    Requirements:
    -Any Rom- (Tested on Acronium 4 and I-Scream)
    -Custom Kernel- (Tested on KGT and Xarc Kernel)
    -300+ sdcard space-
    -Terminal Emulator-
    Source: Google Play
    or Attached File

    Start:
    Download the Swapper2 and install.

    Click Here

    2. Go to terminal emulator type "Free" without the Quotation.
    Make sure you see "0" on the Swap

    Screenshot_2012-08-08-09-42-38.png


    3. open swapper2 go to Setting, Swap size=32 MB, Swappiness=60. (You can Play on the numbers you want I just displayed a Default Swap Settings.)
    Go Advanced preferences check "Recreate swap file" and "Reformat swap" then exit...

    Screenshot_2012-08-08-09-43-39.png


    4. Open Swapper2 click ON it will show some Fail.
    Just wait for few secs or mins and it will continue. If not, Click the ON again.

    Screenshot_2012-08-08-09-44-10.png


    5. Go to terminal emulator type free and you will see that the "0" has been replaced.

    Screenshot_2012-08-08-09-44-23.png


    Screenshot_2012-08-08-09-45-19.png


    Hit thanks if you think I helped.

    Note:
    This just give Everyone Idea that Swapfile is working without Partitioning your SD cards.
    17
    Reserved

    Notes:
    Risk Free..
    Enable/Disable Swap
    Safe SD Card
    Free to experiment what Numbers is suitable on your Settings.
    The swap file Works well when your system Ram went low that can help Handling Running Process and Multitasking.

    ---
    Update.. 0.1
    ---
    For those who cannot do the do the Swap due to Kernel Issue
    Here is a new way without using the Swapper 2

    SOLUTION: How to make simple ZRAM init.d script



    1. Using Root Explorer, got to /sytem/etc/init.d/
    2. press Menu then create new file
    3. paste these in it
    Code:

    #!/system/bin/sh
    sysctl -w vm.swappiness=60
    echo '1' > /sys/block/zram0/reset
    echo $((60*1024*1024)) > /sys/block/zram0/disksize
    mkswap /dev/block/zram0
    swapon /dev/block/zram0

    4. close and save it as 99zram
    5. set permission to 777 or "rwxrwxrwx" (tick all)
    6. take note: 60*1024*1024 = 60MB zram disksize. if you want to set 30MB, change 60 to 30.

    Thanks.

    I will be Unavailable for a Moment. Im creating my own Custom Kernel
    logo.rle_.png
    2
    Does it risk ?

    Nope, I didn't wipe any data..
    You can Enable and Disable Swap anytime
    2
    It's working on my Arc S stock ROM 4.1.B.0.587 with stock kernel. I can now play games like Temple Run 2 without lags. Thanks a lot. :)

    And, just one question. In Google Play info, it said this app can decrease the life span of sdcard. Is it true?

    Sent from my LT18i using xda app-developers app

    Nope it wont..
    2
    I will release another app like this and much better. This one no need require any custom kernel. This november.. This app will be great coz it does not consume ram. It works like setcpu. It makes swap then, auto read on boot.

    Sent from my LT18i using xda premium
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone