Jump to content

Swap issues


Guest Totyasrác

Recommended Posts

Has anyone given any thought to the longevity of the SD card with swap on it? Will using a file instead of a partition allow the SD card's wear-leveling algorithms to function better (by giving them a larger area to move written blocks to)? Setting the swappiness relatively low should result in both less wear-and-tear on the SD card too.

The SD wear levelling will still work regardless of partitions. It will still juggle blocks about if needed.

Link to comment
Share on other sites

I have a couple of questions which i hope someone can clear up (I have read the SWAP threads and Ultimate guides several times but Im still unsure)

1. In the Ultimate pulse guide it says "Pulse SWAP starts to really lag your phone as the apps aren't killed-off at the correct time. Auto-killer can help cure this!"

Does this mean there is a problem with lag just after you enable it only - i.e. after using the emulator to set a2sd lowmem-moderate ? Or does this lag all of the time - in which case i dont undertake why SWAP would be worth using.

2. I already have FLP 1.5 up and working with A2SD on a class 2 4GB sandisc SDHC card. It works ok but some times the core andrioid programs struggle and i get the force close/wait options, and returning to home screen is sometimes slow to refresh (15 secs for icons to be drawn) and somtime browser pages take a long while to render - this i understand as "normal!" on the pulse and low memory related.

I want to keep my apps on the SD card So will ALSO enabling SWAP help with the above delays ?

3. If so is there a simple way to enable keep what i have on the phone and the SD and somehow just enable SWAP I.E. without re-flashing - or repartioning the whole of my SD card.

I have 1GB ext2 partion and 3GB Fat32. I have also already have a Nandriod backup of phone and EXT2 and titantium backup.

Just looking for best and quickiest way to keep what I have but enable swap. Sorry in advance to some of you - i reliase these are probably basic questions for many of you. Hope someone can help.

I simply would not recommend SWAP and A2SD both on a Class 2 Card :lol:

Having both on a Class 4 card was sluggish and laggy. On a Class 6 card (With moderation) it still has some slowdowns

So my advice would be.. Do you prefer:

A faster phone with some multitasking (32mb swap, No A2SD)

Or

A slower phone with no multitasking which you can install as many apps as you please (A2SD No swap)

Or

A slow, laggy phone which freezes and restarts a lot and takes about a minute to open an app (A2SD and swap on a Class 2 card)

On another note.. A 32mb swap partition / file on the Data partition.. A2SD on the SD card.. That way we can toggle USB and have fast Swap. Flibblesan? :)

Link to comment
Share on other sites

Guest Fusion0306
On another note.. A 32mb swap partition / file on the Data partition.. A2SD on the SD card.. That way we can toggle USB and have fast Swap. Flibblesan? :)

That would be great :lol: I guess that would be much faster then swapping on sd card

I'm not using A2SD for now, I'm just testing the 2.2 :)

Swap: using swapper 2 (swap file:32 mb, swappiness:20) on the class 2 card (stock) and it's working quite fast :(

(my new 4 GB class 6 card has ext2 and I didn't want to re-partition it for testing froyo so I just used the stock card)

Edited by Fusion0306
Link to comment
Share on other sites

Guest Poseidonhun

I was using swapper2 with swapfile 128Mb and swappinnes 60, then i was reading Azurren's post about the A2SD swap, so i give it a try.

Formating a linux-swap partition with gparted to 128Mb. The A2SD swap works fine. I am using Class4 8GB with FLB-MOD 1.5 and my Pulse is smooooth :lol:

Conclusion: I think swapper2 good as a2sd swap, but swapper2 using more RAM

Link to comment
Share on other sites

Guest Rumcájsz
FROYO 0.5.1 with swap kernel and dtapps2sd-2.7.5-rc3c-signed. 32MB swap partition created in recovery. My Pulse goes with warp10 now :lol:. No slowdowns at all.

Take Care! With warp 10 you will be a Varanus! :)

Link to comment
Share on other sites

I simply would not recommend SWAP and A2SD both on a Class 2 Card :lol:

Having both on a Class 4 card was sluggish and laggy. On a Class 6 card (With moderation) it still has some slowdowns

So my advice would be.. Do you prefer:

A faster phone with some multitasking (32mb swap, No A2SD)

Or

A slower phone with no multitasking which you can install as many apps as you please (A2SD No swap)

Or

A slow, laggy phone which freezes and restarts a lot and takes about a minute to open an app (A2SD and swap on a Class 2 card)

On another note.. A 32mb swap partition / file on the Data partition.. A2SD on the SD card.. That way we can toggle USB and have fast Swap. Flibblesan? :)

Thanks for the options.

If i decide to move to 32mb swap, No A2SD from what i have now (A2SD and no SWAP) - can i do this without reflashing and starting all over again - i.e. can I move apps on SD to internal data and if so how ? and then how do i create the swap partion while leaving FAT32 partition alone with its existing files/data ?

Awaiting Flibblesans response on 32mb swap partition / file on the Data partition.. A2SD on the SD card - if its possible - this sounds like it could be the best option for me. Thanks again for your help

Edited by cagster
Link to comment
Share on other sites

On another note.. A 32mb swap partition / file on the Data partition.. A2SD on the SD card.. That way we can toggle USB and have fast Swap. Flibblesan? :)

Impossible.

edit: gusthy explains it better. I was just being lazy :lol:

Edited by flibblesan
Link to comment
Share on other sites

Guest Rumcájsz
I've added SWAP to The Ultimate Pulse Owners Guide

After a lot of testing:

Swapper2 causes more issues, more lag and actually uses quite alot of RAM itself. Also it takes an age to start swap after boot.

A2SD Swap is your best option

Turning Off A2SD itself will really decrease lag (Note that you still need an EXT partition to enable swap though)

64mb is an ideal size for a swap partition

using the "a2sd lowmem-moderate" command (Auto killer without the laggy app) really speeds up swap (But sacrifices some of the extra ram)

Thanks! The "a2sd lowmem-moderate" make me happy. :lol:

Now I use 64MB swap partition and "lowmem-moderate" autokiller option. And everything is very quick.

Go a head, mr. Data!

Link to comment
Share on other sites

'You can install A2SD without SWAP and SWAP without A2SD. If your SD card is below a "Class 6" then it is highly recommended that you install SWAP without A2SD.'

Thanks. This has cleared some things up:

The reason I was interested in using swapper2 rather than swap partition was if I could put the swap file on the phone DATA partition (which is faster than the sd card/swap partition, plus then I could still use a2sd without interfering/reducing performance with the swap as that would be on physically different memory (internal)

So does anyone know at least in theory, if its possible to use DATA partition as swap (with swap file on it). Also am I correct in thinking phone memory (not ram!) is faster than SD class 6?

It is highly discouraged - it reduces the lifecycle of your phone's internal storage which is not replacable.

Link to comment
Share on other sites

Guest Rumcájsz
I can't seem to see poll results without voting :) Can someone post them?

What do you use for swap?

Darktremor apps2sd 2.7.5 rc2 [ 15 ] [28.85%]

Darktremor apps2sd 2.7.5 Final [ 7 ] [13.46%]

Swapper2 [ 29 ] [55.77%]

Something else (please specify in comment) [ 1 ] [1.92%]

Partition or file?

Partition [ 30 ] [58.82%]

File [ 21 ] [41.18%]

Size?

16MB [ 0 ] [0.00%]

32MB [ 23 ] [41.07%]

64MB [ 17 ] [30.36%]

128MB [ 9 ] [16.07%]

bigger [ 3 ] [5.36%]

Cheese :lol: [ 4 ] [7.14%]

Link to comment
Share on other sites

Well I'm using Darktremor A2SD 2.7.5 final. I modified the script to set swappiness to 15, instead of using the system default of 60, and it seems to be working better with jit enabled.

Link to comment
Share on other sites

Guest Rumcájsz
anyone tried with dalvik and swapper2 swap file on SD card?

I use a2sd 2.7.5 RC2 and Dalvik cache on the SD card.

First, I tried 64 MB swap partition, and it was very slow

Then I tried swapper2 (32 MB swap file on sd card) - first time it was quick, but later it was laggy.

then I tried swapper2 and swap partition, it was little bit stable, but still laggy

finally I disable swapper2, and enable swap in a2sd, and I use "lowmem-moderate" option, and I have no problem now.

Link to comment
Share on other sites

Well I'm using Darktremor A2SD 2.7.5 final. I modified the script to set swappiness to 15, instead of using the system default of 60, and it seems to be working better with jit enabled.

And so far I've had no random reboot. I consider this a success :lol:

Link to comment
Share on other sites

The first boot is chaotic with SWAP + A2SD

All you can do is wait for the SD card to mount (No swap until it has) and disabling A2SD really increases performance (If you have a class 4 or below card) and set-up the auto kill values (written on the a2sp / swap section of the Ultimate Pulse Owners Guide)

After a hell of a lot of testing the only reason why Swapper2 seems faster is because most of the fist-boot lag is gone before you actually use it. Side-by-side it is slower than A2SD

Give A2SD a fighting chance to get it right. With the above tweaks it runs like a charm :lol:

"Chaotic" is the understatement of the year! Seriously.

It tried to boot. It took FOREVER (at least 10 minutes) to get to the Sim unlock screen, and before I could enter anything, it dropped back to the boot animation. The boot animation then proceeded to run at about 1 frame every 15 seconds. I waited many, many more minutes. It finally returned to the unlock screen. It would register each button click after about a 10 second lag on each one. After supposedly booting, the lag continued. Every click took at least 10 seconds to do anything. Attempting to turn off swap in Terminal just sat there and sat there and seemed to be doing nothing. Assuming it finally had just completely hung up, I pulled the battery.

After attempting one reboot, and seeing the exact same behavior from the phone, I pulled the battery and the SD card and removed the swap partition. Before event attempting to reboot, I restored my previous backup (assuming the likelihood of a big mess awaiting me was quite high).

Maybe this weekend I'll have another go at it, following your instructions to a tee. I don't mind experimenting at all, but that last one went very badly.

Link to comment
Share on other sites

"Chaotic" is the understatement of the year! Seriously.

It tried to boot. It took FOREVER (at least 10 minutes) to get to the Sim unlock screen, and before I could enter anything, it dropped back to the boot animation. The boot animation then proceeded to run at about 1 frame every 15 seconds. I waited many, many more minutes. It finally returned to the unlock screen. It would register each button click after about a 10 second lag on each one. After supposedly booting, the lag continued. Every click took at least 10 seconds to do anything. Attempting to turn off swap in Terminal just sat there and sat there and seemed to be doing nothing. Assuming it finally had just completely hung up, I pulled the battery.

After attempting one reboot, and seeing the exact same behavior from the phone, I pulled the battery and the SD card and removed the swap partition. Before event attempting to reboot, I restored my previous backup (assuming the likelihood of a big mess awaiting me was quite high).

Maybe this weekend I'll have another go at it, following your instructions to a tee. I don't mind experimenting at all, but that last one went very badly.

A2SD really needs the swappiness set to 10 or 15, and not 60 (system default). Swappiness can be a number between 0 and 100. The higher the number the more system will swap. Because the system default is 60, and the very first boot sets up a load of caches, it slows our phones down horribly. Setting swappiness to 10 or 15 means that the system doesn't swap unless it absolutely needs to. In my eyes thats exactly how swap should be.

And another thing, A2SD swap, 60 swappiness and jit = random reboots. Set the swappiness to 15 and reboots have gone. Phone is stable.

I'll patch A2SD files for the next release of FLB 2. In the meantime you can do it yourself by editing starta2sd and launcha2sd files in /system/bin/ (Do this with A2SD 2.7.5 final standard).

You need to find the swapon command and add the swappiness between that and mkswap like this:

					$bbcmd mkswap /dev/block/mmcblk0p3 | $bbcmd tee -a $a2sdlf;
$bbcmd echo 15 > /proc/sys/vm/swappiness | $bbcmd tee -a $a2sdlf;
$bbcmd swapon /dev/block/mmcblk0p3 | $bbcmd tee -a $a2sdlf;[/code]

Save the files, chmod 777. Then reboot.

Feel free to experiment with the swappiness value.

Link to comment
Share on other sites

Anybody knows "perfect" settings? I'm using A2D RC2, a partition of 32mb and the default swappiness. Normally its working really good, but sometimes it's really slowly down and there is a lag. But after one or two minutes the lag is past and everything is fine. I think I will modify the swappiness and see if it's become better.

Link to comment
Share on other sites

A2SD really needs the swappiness set to 10 or 15, and not 60 (system default). Swappiness can be a number between 0 and 100. The higher the number the more system will swap. Because the system default is 60, and the very first boot sets up a load of caches, it slows our phones down horribly. Setting swappiness to 10 or 15 means that the system doesn't swap unless it absolutely needs to. In my eyes thats exactly how swap should be.

And another thing, A2SD swap, 60 swappiness and jit = random reboots. Set the swappiness to 15 and reboots have gone. Phone is stable.

I'll patch A2SD files for the next release of FLB 2. In the meantime you can do it yourself by editing starta2sd and launcha2sd files in /system/bin/ (Do this with A2SD 2.7.5 final standard).

You need to find the swapon command and add the swappiness between that and mkswap like this:

					$bbcmd mkswap /dev/block/mmcblk0p3 | $bbcmd tee -a $a2sdlf;

					$bbcmd echo 15 > /proc/sys/vm/swappiness | $bbcmd tee -a $a2sdlf;

					$bbcmd swapon /dev/block/mmcblk0p3 | $bbcmd tee -a $a2sdlf;

Save the files, chmod 777. Then reboot.

Feel free to experiment with the swappiness value.

i have swappiness set to default (60) from the day you released the rom with 32Mb swap partition and had no reboots at all and no fc`s. Its funny how it behaves differently from phone to phone when they should be all the same piece of hardware, right?

Link to comment
Share on other sites

Guest goce.nakov
i have swappiness set to default (60) from the day you released the rom with 32Mb swap partition and had no reboots at all and no fc`s. Its funny how it behaves differently from phone to phone when they should be all the same piece of hardware, right?

Same here but still....

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.