I have created a 1 GB a2sd partition in CWM, works perfect! Every app is on sd-card. In the same menu in CWM there was an option to create a swap partition, so I created a 256 MB partition. After reboot I checked in terminal if swap worked. Typed "su" followed by "free", swap showed 0 0 0... But then I found an app in Google Play named "ResetSwap" where I can turn swap partition on/off. When I check in terminal it works great! The "problem" is that every time I reboot I have to manually turn swap on in ResetSwap. Is there a way to make the swap partition autostart after boot??
Thanks in advance!
Sent from my ST18i using xda premium
U need another kernel rather than the official one
Hi there
what u need is to flash a kernel support swap function which the official doesn' t.
swap needs kernel support to work.
AND flash unofficial kernel means U need get ur bootloader unlocked.
If that's what u don't want , then give up.
if not there are instructions on this forum, just follow it.
In my opinion, if u don't play huge game ,ray's 512 ram is just enough for daily surf and simply work.
Hi!
Thank you for answering. My bootloader is unlocked, I'm running Sirkay v.6 @ 1,6 Ghz. Rooted + supercharged. The stock Xperia Home is freezed in Titanium Backup, I only use Launcher Pro. I have got the swap partition to work, only it doesn't start automatically when boot. It has to be done manually. I want it to start automatically. But I have found that there's use for the swap. I have lots of apps that together eats a lot of ram. Generally I have about 50-60 MB of free ram and the system also uses about 120-150 MB of the swap partition! I know the SD-card isn't as fast as the ram, but I don't see any difference when using it. Its an Samsung 32 GB class 10. Before I created the swap partition I got lot of crashes from several apps, I guess it ran out of ram. Maybe some say its not because of low ram that makes them crash, its because Launcher Pro isn't built for ICS. But I'm using the phone all the time, lots of multitasking. Have to charge the battery at least 2 times every day. So I'm pretty sure the swap file is working great, I get no crashes with the swap enabled. But I do get them without, several times every day. But basically, I just wanted to know if its possible to autostart the swap-file.
Best regards!
Sent from my ST18i using xda premium
open notepad or creat newfile with xplorer, name it swapper or what you like. type this command
#/system/bin/sh
swapon /dev/block/mmcblock0p3
save it and put it to /etc/init.d chmod it 777
hope it work for u
It's actually swapon /dev/block/mmcblk0p3 not mmcblock0p3.
Related
Hi guys, this morning I have tryed to install the swap script on kyrillos 9.1 by the old script in the /system/etc/init.id directory, but when I launch the free command on emulator terminal in the swap partition show 0 0 0.
So I think that the script doesn't works, infact I don't find the log of swap anywhere. Also on normal usage of phone, I always have low ram available.
I have found in this page http://wiki.cyanogenmod.com/wiki/Swap_and_Compcache this app https://market.android.com/details?id=lv.n3o.swapper2&hl=en. Does anyone have tryed this app before?
After the installation and configuration, I have tryed to open some apps and keep they in background. So, I launch free command in terminal emulator and I can see the swap partition with the memory used and free, which mean that the swap works.
The phone is also smooth and very responsive, with more ram available.
Now I wonder, why the old script doesn't works?
And this app, swapper 2, is a good app? Is convenient to use?
What is the experts advice?
P.s.: Sorry for my english.
Ok. I do not mean any offence to junghyun01.
However this is another method & the one that I personally use.
This requires: stock kernel & dual mode recovery (ClockWorkMod).
Some version of ClockWorkMod that come with custom kernels do not include the necessary options to format your sd-card.
To return to stock kernel on gingerbread or froyo, follow this guide:
http://forum.xda-developers.com/showpost.php?p=21238366&postcount=2
This is the easiest way to create sd-ext/2nd partition+swap partition on sdcard with our phones:
1: Backup all data from sdcard to computer *Important*.
2: Boot into ClockWorkMod by tapping touch-screen while on Sony Ericsson screen
WARNING: We will now delete all data on sdcard, that is why you made a backup.
3: Advanced => Partition SD Card => 512M or 1024M (depending how many apps you want to install & the size of your sdcard) => 0mb for swap size (or if using a custom kernel you can set a swap size of 128m) => Yes to format.
4:Power Off phone.
5:Remove sdcard and put into computer, put the files that you backed up to the computer back on the sdcard.
6:Insert sdcard back into phone and power on. Click thanks.
How to enable swap? Warning: This can & will shorten your sd-cards life. Read post #2!
(Swap will only work on a custom kernel!)
After flashing the rom of your choice, flash the add-on "x8EnableSwapPartition2.zip" in ClockWorkMod to enable swap or download ResetSwap from the market.
Credits:
junghyun01 go on give him a thanks for giving me the motivation to create this thread.
[email protected](me): Flashable add-on zip, guide, time, information. Click thanks!
x8EnableSwapPartition2.zip=Swappiness set at 40%.
x8EnableSwapPartition.zip=Swappiness set at Android default 60% or whatever % your rom developer has set it at.
More Information: (You don't really need to read this but if you are interested...)
Stock Kernel?? Oh man...
I personally think it is worth it for all users to flash back to stock kernel & dual mode recovery. Why? Just so they can partition their sd-card like this, as sd-ext will be formatted in Ext4.
Ext4=Best speed/reliability overall. Why would you still be using ext2/3???
Why only 128mb swap size?
Because it is wasteful to create a larger swap partition. It never gets used. I have never seen 128mb's of swap used on our phone & that is even with heavy games/apps running in the background. You are just making your sd-card size smaller for no benefit.
Why not just use Swapper2 from the market with a swap(.swp) file?
Swapper2 is notorious for slowing down your phone as it likes to auto-start all the time also a swap file will not be as fast as a swap partition.
Will SWAP shorten SD-card lifespan???
Yes it undoubtedly will. Will you be able to notice this in any way? Most probably not.
Using swap will cause intensive reading/writing in one region of the sd-card. All flash memory devices (including our NAND internal memory) have limited write cycles. Excessive reading/writing causes bad blocks on your sd-card. Some sd-cards have extremely poor write cycles, so they can & will burn out when using swap.
Some people believe it would take a full year or even longer of using swap to actually cause any noticeable effect on your sd-card. Even if it does cause bad blocks on you sd-card, when formatting your sd-card with most modern-day file systems, these blocks will be marked as bad blocks and they wont be used. This equals to an extremely slow decrease in total capacity of your sd-card (which will be close to unnoticeable) .
Having said all of that there has been reported cases where SD-Cards have burned out and stopped working almost directly after enabling swap. Coincidence? Who knows but...What you do & flash to your phone is your own decision & no one else is in any way responsible for what happens except you.
And another method if you need it:
http://forum.xda-developers.com/showthread.php?t=1445543
Or guide with pictures:
You can create an ext partition on your sdcard in windows by downloading the newest Easeus Partition Manager Here or at their Homepage.
After installing the program use the guide found here:
http://forum.xda-developers.com/showthread.php?p=10654666
I have tried this method and it works with Ext2 and Ext3.
I use alf kernel + Gdx 21
I already partition my sd card using mini tool partition wizard as follow
1. primary Fat32
2. primary Ext4
3. primary LinuxSwap
already flash the addon , but still no swap active when i check on terminal.
i see on your zip that it make swap on /dev/block/mmcblk0p3
but in mine there's only /dev/block/vold -> which is empty also
I don't know if my swap partition is load .
still there's /sys/dev/blok/179:3 which refer to mmcblk0p3
and on sys/block/mmcblk0
I'm not familiar with linux , so please give me a guide what to do.
thanks
aries77 said:
I use alf kernel + Gdx 21
I already partition my sd card using mini tool partition wizard as follow
1. primary Fat32
2. primary Ext4
3. primary LinuxSwap
already flash the addon , but still no swap active when i check on terminal.
i see on your zip that it make swap on /dev/block/mmcblk0p3
but in mine there's only /dev/block/vold -> which is empty also
I don't know if my swap partition is load .
still there's /sys/dev/blok/179:3 which refer to mmcblk0p3
and on sys/block/mmcblk0
I'm not familiar with linux , so please give me a guide what to do.
thanks
Click to expand...
Click to collapse
How to u check if swap is running or not?? Type wat code on terminal..
Sent from my E15i using xda premium
kakho55 said:
How to u check if swap is running or not?? Type wat code on terminal..
Sent from my E15i using xda premium
Click to expand...
Click to collapse
on terminal type --> free
export PATH=/data/local/bin:$PATH
$ export PATH=/data/local/bin:$PATH
$free
total used free shared buffers
Mem: 186704 183584 3120 0 132
-/+ buffers: 183452 3252
Swap: 33596 25304 8292
$
So it work or not? ?
Sent from my E15i using xda premium
kakho55 said:
export PATH=/data/local/bin:$PATH
$ export PATH=/data/local/bin:$PATH
$free
total used free shared buffers
Mem: 186704 183584 3120 0 132
-/+ buffers: 183452 3252
Swap: 33596 25304 8292
$
So it work or not? ?
Sent from my E15i using xda premium
Click to expand...
Click to collapse
Swap: 33596 25304 8292
yes it work..
ok, it works now.
Re-download and flash.
(You can delete old script in etc/init.d)
8xfan said:
Swap: 33596 25304 8292
yes it work..
Click to expand...
Click to collapse
but i cant see any different .... ram still around 28mb ...><
Sent from my E15i using xda premium
lrakkarl said:
ok, it works now.
Re-download and flash.
(You can delete old script in etc/init.d)
Click to expand...
Click to collapse
thanks, it works now
works.. thx.. ..
btw, can someone please explain why did SWAP shorten SD card lifespan??
kakho55 said:
but i cant see any different .... ram still around 28mb ...><
Sent from my E15i using xda premium
Click to expand...
Click to collapse
LOL i dont know..maybe OP can answer it
Thankyou,thats worked!
Just forget to disable compcache,but there no problem at all!
I have updated both post #1 & #2 with the information requested. Please give it a read.
@kakho55
Swap allows you to run more apps/processes at any one time. The android operating system will still use all of your real ram too.
What about the swapping coefficient, in the script is not defined. This number is showed in procent and defines the ratio of swap partition being used by the system.
One question,i using Reset Swap and everytime i reboot i need to go to app and activate swap again,thats normal?And if i flash the EnableSwap.zip?
gdeliana said:
What about the swapping coefficient, in the script is not defined. This number is showed in procent and defines the ratio of swap partition being used by the system.
Click to expand...
Click to collapse
Uploaded new add-on & modified first post to answer your question.
(if no value specified then Android default setting is 60%)
RodrigoOgasawara said:
One question,i using Reset Swap and everytime i reboot i need to go to app and activate swap again,thats normal?And if i flash the EnableSwap.zip?
Click to expand...
Click to collapse
Yes that is normal if using ResetSwap. This is because it never auto-starts by itself.
If you flash the add-on zip then swap will be auto enabled every boot.
hi.. new addon.is for ??
lrakkarl said:
Uploaded new add-on & modified first post to answer your question.
(if no value specified then Android default setting is 60%)
Yes that is normal if using ResetSwap. This is because it never auto-starts by itself.
If you flash the add-on zip then swap will be auto enabled every boot.
Click to expand...
Click to collapse
Thanks mate
If you feel like your eris does not run as smooth as before, this might help you.
I finally found out why my eris feel slower now, it is because it doesnt have enough ram, new roms requiere mor ram and lets be honest the eris was made for android 1.5 not for 2.3 so heres the thing, with all these new roms at boot the eris has at least 85-90% of ram memory occupied, which is bad, really bad.
Well first of all a little intro:
Apps are classified in these different "kinds" by android
- FOREGROUND_APP: App currently on screen and running.
- VISIBLE_APP: App running but in the background
- SECONDARY_SERVER: Services
- HIDDEN_APP: App running but hidden in case it is needed for something else at some point
- CONTENT_PROVIDER: This is apps that provide data (content) to the system.
- EMPTY_APP: Apps that you have opened, but are done with them.
Now that you know that, there are 2 ways of getting a faster eris, please read both ways since one is needed for the other one.
1 - For people who just want the eris to get faster and dont care about opening lots of apps
Heres what you need:
- Droid Eris Rooted
- Terminal Emulator
The android system itself has a very nice way to run things, sadly, the default parameters are not enough for us anymore.
The parameter im talking about is the "minfree" which basically specifies the minimum ram the OS should have.
This is better than task killer apps, since it uses Android OS kernel to get mroe memory and not a third party application.
Open up your terminal emulator and type this:
su
cat /sys/module/lowmemorykiller/parameters/minfree
that should show you what your parameters are right now, which should be something like this:
1536,2048,4096,5120,5632,6144
These numbers are pages. To Android, a page is equal to 4 kb. So in the above example, the EMPTY_APP settings (last in the list -- 6144) is 24 MB. 6144 pages = 24576 kb = 24 MB. The formula would be: ((6144 * 4)/ 1024)
Ok so what we need is to change at least that parameter (feel free to tweak the others but basically this is the more useful), we should pout in there something like at least 50 MB, so to change it type this in your terminal:
su
echo "1536,2048,4096,5120,15360,12800" > /sys/module/lowmemorykiller/parameters/minfree
and that should give you a faster eris, or at least a smoother one, you can tweak the other parameters aswell but I would not recommend it so much, because you are messing with the kernel too much, but hey! its your eris you can do whatever the hell you want with it, you have to do this everytime you reboot by the way.
2 - For people who want a faster eris but also want to open lots of apps at the same time
Well to you guys i do recomend tweaking all the parameters, because will have more memory, the difference is that whats been working for me is making a Linux Swap partition on my SD card, as a side note i did try apps like swapper which make a swap file but they didnt work so well from my point of view.
It is easy to do so in a Linux OS with this command:
mkswap /dev/mmcblk0 512
where:
mkswap = command
/dev/mmcblk0 = your device for the linux OS
512 = Swap partition size
If you feel like this is too much for you I wuold recommend doing this from gparted which is a partition manager for Linux and it has a GUI, you can download a live cd of parted magic and open it from there in case you dont have linux.
You can also do this from recovery, i dont konw about clockworks but there is an option to partition your sd card in Amon-Ra's recovery and there you just enter the size for each partition, i do not recommend this because i couldnt read my sd card in my computer after that, but it could have been something else, plus i fixed it formatting it again.
Ok so lets say you have your sd card with a swap partition, what you have to do now is "tell" android that it can use this space as RAM, this is done by the following command
first get root access:
su
then
swapon /dev/block/mmcblk0
and now well tweak another parameter which "tells" android how often it should use swap instead of real RAM, you can do this like this:
su (only if you dont have root access yet)
sysctl -w vm.swapiness=40
you can change 40 for a different number but by trial and error thats the number thats given me best results.
Remember!: You have to do this everytime you reboot!
Hope this is helpful!
Im sorry if it is not explained so well , but its 4 am and I really need to go to bed, lol, if you have doubts just ask!
HI,
It's my first post here and I'm glad to be a member on this fantastic website.
I have a problem with the swap partition on my device, Xperia arc.
I flashed my device to "LT15i 4.1.B.0.431 Generic Global World" follow by this post.
I found that lacking in memory so I tried to use swap partition and created 256 Linux swap partition on my SD card. But "free" commend still shows swap=0
However, I decided to use swapper 2. Still no effect and I couldn't get swap although swapper did its job without fail!
After few days search I found that the kernel doesn't support the swap, So, I tried to use "Kernel.sin unpacked and added CWM options" form here. It also didn't work, neither "init.d zram scripts from wedgess" from the same page.
However, I'm looking for help to use swap on my device or any suggestion that can help me to improve memory in my device.
P.s. I'm a newbie in Android and still don't understand it very well specially those names like rom and etc, but I have been using Linux (Fedora) for 6 years.
edanny101 said:
HI,
It's my first post here and I'm glad to be a member on this fantastic website.
I have a problem with the swap partition on my device, Xperia arc.
I flashed my device to "LT15i 4.1.B.0.431 Generic Global World" follow by this post.
I found that lacking in memory so I tried to use swap partition and created 256 Linux swap partition on my SD card. But "free" commend still shows swap=0
However, I decided to use swapper 2. Still no effect and I couldn't get swap although swapper did its job without fail!
After few days search I found that the kernel doesn't support the swap, So, I tried to use "Kernel.sin unpacked and added CWM options" form here. It also didn't work, neither "init.d zram scripts from wedgess" from the same page.
However, I'm looking for help to use swap on my device or any suggestion that can help me to improve memory in my device.
P.s. I'm a newbie in Android and still don't understand it very well specially those names like rom and etc, but I have been using Linux (Fedora) for 6 years.
Click to expand...
Click to collapse
Did you try manually turn on swap with "swapon"?
Also you can create swap in file.
Code:
cd <to your SD card>
dd if=/dev/zero of=swapfile bs=1024 count=65536
mkswap swapfile
swapon swapfile
Thanks a lot for your kind reply.
I flashed my device to cm10 and it works much better.
I tried to remove this post but I could not.
Thanks anyway for your time to read my post and reply.
Cheers.
Hello all, as some of you know that there is a way that lets you increase your device's ram capacity, and that is by swap, well am here to give you simple and easy steps to enable swap on your device.I only tested this on few devices so don't complain if it didn't work.
I'am not responsible for any damage could happen, you are doing it at your own risk.
Prerequisites
1-An android phone (duhh )
2-Must be rooted.
3-Busybox xbin. (Read below)
4-Kernel Must Support Swap
Tested devices
-Galaxy Ace S5830
-Galaxy Ace S5830i
-Galaxy Ace 2
-Galaxy S4 (don't ask why!)
-Galaxy S4 mini
-Galaxy Ace Plus
-Sony Xperia Sola
Tested android versions
-2.3.x
-4.0.x
-4.1.x
-4.2.2
-4.3.0
-4.4.2 (got some problems)
-4.4.4 (got some problems)
kitkat users may find a problem that swap has a limit of 50 MB or 150 MB ( Caused by the new 4.4.x kernel Just Try It)
Installing busybox xbin
{If you are not sure what is this then just go to how to swap
And if swap didn't work the come back here and apply the steps}
1-Download busybox from playstore or buy the pro version
2-Run busybox
3-Wait for the loading
4-Then normal install or smart install in case you are in pro.
5-When done installing restart your phone
How to swap
1-Install simple root swap
2-Run it and give it root permission
3-Specify the size of swap file (how much MB you want to add as virtual ram) (big size needs more time)
4-Create swap file
5-Check enable at boot
6-Click on
7-Check if the swap worked
8-Enjoy...
reserved
I did every thing and nothing happened ?
I have xperia u with Experimental v12...
Sent from my Xperia U using XDA Premium 4 mobile app
Heads up! using swap on SD card may decrease your SD card's lifetime.
Can we damage our systems any how?Can I try this on a auto navi system with Android 4.0.3?
Thx
Sent from my iPhone using Tapatalk
Csi02 said:
Can we damage our systems any how?Can I try this on a auto navi system with Android 4.0.3?
Thx
Sent from my iPhone using Tapatalk
Click to expand...
Click to collapse
Since the swap file in made on the SD Card, No, it will not damage your system but there is a high chance it can affect the SD Card. If you have an SD Card, then yes you can try this on Auto Navi System with Android 4.0.3. Make sure to have a class 8 or greater SD Card to get maximum speed. Hope I Helped
Thx for your answer! I will try it after I buy another SD class! I hope that will make my unit a little smoother!
Sent from my iPhone using Tapatalk
It does NOT work on Galaxy Ace S5830i with this ROM and this kernel...
MorgenTee said:
It does NOT work on Galaxy Ace S5830i with this ROM and this kernel...
Click to expand...
Click to collapse
Can you find the swap file on your SD Card? If not then can you tell us exactly what happens when you choose to create swap?
mahithm said:
Can you find the swap file on your SD Card? If not then can you tell us exactly what happens when you choose to create swap?
Click to expand...
Click to collapse
The file is there, it has the size that I choose in "Simple Root Swap". I tried 200 MB and 100 MB.
The "Info" tab of "Simple Root Swap" tells me however:
Status Swap:
Total Swap: 0MB
Used Swap: 0MB
Free Swap: 0MB
When I open a terminal emulator "free" tells me 0 swap, "swapon -a" tells me that /etc/fstab does not exist...
MorgenTee said:
The file is there, it has the size that I choose in "Simple Root Swap". I tried 200 MB and 100 MB.
The "Info" tab of "Simple Root Swap" tells me however:
Status Swap:
Total Swap: 0MB
Used Swap: 0MB
Free Swap: 0MB
When I open a terminal emulator "free" tells me 0 swap, "swapon -a" tells me that /etc/fstab does not exist...
Click to expand...
Click to collapse
Did you press the On button below Auto Start? Once you create the Swap file using the Re/ Create button, tick the Auto Start box and press the On button below that. That should activate swap on SD Card. Now check Info to see your swap details or use "free" on Terminal. Do post the result. Hope I Helped
mahithm said:
Did you press the On button below Auto Start? Once you create the Swap file using the Re/ Create button, tick the Auto Start box and press the On button below that. That should activate swap on SD Card. Now check Info to see your swap details or use "free" on Terminal. Do post the result. Hope I Helped
Click to expand...
Click to collapse
I have done that already. After the creation of the swap file, I checked "Auto Start" and clicked "on". I also tried restarting the phone, but it didn't change anything.
MorgenTee said:
I have done that already. After the creation of the swap file, I checked "Auto Start" and clicked "on". I also tried restarting the phone, but it didn't change anything.
Click to expand...
Click to collapse
Did you install BusyBox? Creating and running swap requires certain binaries which may not be present in the rom by default. Do post the result.
mahithm said:
Did you install BusyBox? Creating and running swap requires certain binaries which may not be present in the rom by default. Do post the result.
Click to expand...
Click to collapse
Yes, I followed the instructions (see below) in the first post exactly.
Installing busybox xbin
{If you are not sure what is this then just go to how to swap
And if swap didnt work the come back here and apply the steps}
1-downlpad busybox from play store or buy th pro version
2-run busybox
3-wait for the loading
4-then normal install or smart install incase you are in pro.
5-when done installing restart your phone
How to swap
1-install simple root swap
2-run it and give it root permission
3-specify the size of swap file (how much mb you want to add as virtual ram) (big size needs more time)
4-create swap file
5-check enable at boot
6-click on
7-check if the swap worked
8-enjoy...
Click to expand...
Click to collapse
Is it possible that the kernel I am using is lacking swap capabilities and therefore, the app cannot make swap work?
MorgenTee said:
Yes, I followed the instructions (see below) in the first post exactly.
Is it possible that the kernel I am using is lacking swap capabilities and therefore, the app cannot make swap work?
Click to expand...
Click to collapse
Since you have followed all the instructions perfectly, it must be the kernel. Rafael's kernel does have swap support though.
mahithm said:
Since you have followed all the instructions perfectly, it must be the kernel. Rafael's kernel does have swap support though.
Click to expand...
Click to collapse
Thanks! Too bad that it won't work for my setup. I will consider trying the other kernel once I do have some more time on my hands.
This worked very well for me. Thanks OP! :good:
MorgenTee said:
The file is there, it has the size that I choose in "Simple Root Swap". I tried 200 MB and 100 MB.
The "Info" tab of "Simple Root Swap" tells me however:
Status Swap:
Total Swap: 0MB
Used Swap: 0MB
Free Swap: 0MB
When I open a terminal emulator "free" tells me 0 swap, "swapon -a" tells me that /etc/fstab does not exist...
Click to expand...
Click to collapse
Your kernel might not support swap...
M2M_RockS said:
I did every thing and nothing happened ?
I have xperia u with Experimental v12...
Sent from my Xperia U using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Check your kernel swap support...
Sorry for flooding... I hv a que. Can I use swap in rom TWRD 1.0
Sent from my GT-S5830i using xda app-developers app