Jump to content

Swap issues


Guest Totyasrác

Recommended Posts

Thanks for the guide, Azurren.

Edit: Oh, one more thing. What's with this? "SWAP starts to really lag your phone as the apps aren't killed-off at the correct time. Auto-killer can help cure this!" If "snappiness" is set lower (i.e. 15 as Fibblesan says), is this still an issue? How can this be avoided without installing a task killer?

:lol:

And your recommendation - according to the Pulse owners guide - is not to modify the swappiness?

The A2SD lowmem-moderate commands does the same as auto killer. It also does the same job as lowering swappiness..

An app uses some swap ram and some internal ram. When the internal ram gets real low the phone starts to lag. However the apps aren't killed off because there is still alot of SWAP ram remaining. But the above cures this :)

Link to comment
Share on other sites

How to find out which class a SDcard is ?

i got 2 SDcards different brand with 8GB and a speedtest shows speed while reading 15-16Mb/s

did not run the write test yet.

so is this a class 4 or 6?

Link to comment
Share on other sites

Guest Totyasrác
How to find out which class a SDcard is ?

i got 2 SDcards different brand with 8GB and a speedtest shows speed while reading 15-16Mb/s

did not run the write test yet.

so is this a class 4 or 6?

According to Wikipedia:

The following are the ratings of some currently available cards:

* Class 2: 2 MB/s

* Class 4: 4 MB/s

* Class 6: 6 MB/s

* Class 10: 10 MB/s

Yours measured ~16Mbps which equals to 2MB/s (8bit=1Byte) so your SD is class2.

Otherwise if it is not written on the card it is usually class2. Classes 4 and 6 are marked on the card, like this:

post-643642-1284759819_thumb.jpg

Link to comment
Share on other sites

According to Wikipedia:

The following are the ratings of some currently available cards:

* Class 2: 2 MB/s

* Class 4: 4 MB/s

* Class 6: 6 MB/s

* Class 10: 10 MB/s

Yours measured ~16Mbps which equals to 2MB/s (8bit=1Byte) so your SD is class2.

Otherwise if it is not written on the card it is usually class2. Classes 4 and 6 are marked on the card, like this:

post-643642-1284759819_thumb.jpg

I read this in wikipedia.. but seems to be not reality.

I measure 15 MegaBytes/s reading and 5.5 MegaBytes/s (not bits) writing.

both SDcard do his.

i am sure its not a class 15 :lol: card.

or means the class the write speed ? so then its a class 4

EDit: found the mark! its 4. so its write speed. Thanks!

Edited by curl66
Link to comment
Share on other sites

Guest Totyasrác
I read this in wikipedia.. but seems to be not reality.

I measure 15 MegaBytes/s reading and 5.5 MegaBytes/s (not bits) writing.

both SDcard do his.

i am sure its not a class 15 :) card.

or means the class the write speed ? so then its a class 4

EDit: found the mark! its 4. so its write speed. Thanks!

Please check again... Mbps = Megabits/sec. MBps = MegaBytes/sec.

So again: 16 megabits = 2 megaBytes.

Pretty sure you ain't gonna measure 15 megaBytes of reading and 5.5 megaBytes of writing your SD every second :lol:

Link to comment
Share on other sites

Please check again... Mbps = Megabits/sec. MBps = MegaBytes/sec.

So again: 16 megabits = 2 megaBytes.

Pretty sure you ain't gonna measure 15 megaBytes of reading and 5.5 megaBytes of writing your SD every second :lol:

I am sure. the tool measures in MegaBytes. I kow the difference between, bit,nibble,bytes,words,longwords :)

thanks

Link to comment
Share on other sites

The A2SD lowmem-moderate commands does the same as auto killer. It also does the same job as lowering swappiness..

An app uses some swap ram and some internal ram. When the internal ram gets real low the phone starts to lag. However the apps aren't killed off because there is still alot of SWAP ram remaining. But the above cures this :lol:

Swap is only meant to be used when absolutely necessary as it's not a replacement for ram. So by setting the swappiness figure low this ensures that Android functions as it should and moving unused processes to swap to free up main ram when you launch an application that needs it.

Playing about with the built-in memory management settings does nothing to improve the situation. It may seem quicker but that's because apps are being killed more often. Android does not see swap as memory at all so actually changing the memory management settings is completely useless regarding swap.

SWAP is not RAM.

Link to comment
Share on other sites

Swap is only meant to be used when absolutely necessary as it's not a replacement for ram. So by setting the swappiness figure low this ensures that Android functions as it should and moving unused processes to swap to free up main ram when you launch an application that needs it.

Playing about with the built-in memory management settings does nothing to improve the situation. It may seem quicker but that's because apps are being killed more often. Android does not see swap as memory at all so actually changing the memory management settings is completely useless regarding swap.

SWAP is not RAM.

A very clear description of the situation. Thats why I guess that if swap is big enough, the whole lowmem management can be considered "turned off" and therefore the two different memory management mechanisms (swap and lowmem) won't mess up each other.

Link to comment
Share on other sites

Swap is only meant to be used when absolutely necessary as it's not a replacement for ram. So by setting the swappiness figure low this ensures that Android functions as it should and moving unused processes to swap to free up main ram when you launch an application that needs it.

Playing about with the built-in memory management settings does nothing to improve the situation. It may seem quicker but that's because apps are being killed more often. Android does not see swap as memory at all so actually changing the memory management settings is completely useless regarding swap.

SWAP is not RAM.

Well really I don't know how it works :lol:

All I know is that the internal memory seems to get extremely low before it starts killing off tasks with the default settings. The a2sd lowmem-moderate provides a clearly visible difference (As in quicker than stock vs laggy as hell)

Link to comment
Share on other sites

Swap is only meant to be used when absolutely necessary as it's not a replacement for ram. So by setting the swappiness figure low this ensures that Android functions as it should and moving unused processes to swap to free up main ram when you launch an application that needs it.

Playing about with the built-in memory management settings does nothing to improve the situation. It may seem quicker but that's because apps are being killed more often. Android does not see swap as memory at all so actually changing the memory management settings is completely useless regarding swap.

SWAP is not RAM.

					$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;
Any possibility of FLB 1.6b with your settings added? Pretty please, with sugar on top? :lol: If not, do I recall correctly that FLB 1.6 is still using rc2 and not final of apps2sd? If I use those same values you posted earlier with rc2, am I gonna have a mess, or will thing be alright? Edit: In launcha2sd there are two references to "swapon". Do I assume correctly that it should be set in both places?
		$bbcmd mkswap /dev/block/mmcblk0p3 | $bbcmd tee -a $a2sdlf;

		$bbcmd echo "[ ] Make Swap command returned code: $?" >> $a2sdlf;

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

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

			$bbcmd echo "[ ] Make Swap returned code: $?" >> $a2sdlf;

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

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

Thanks.

Edited by twrock
Link to comment
Share on other sites

(Edit: the attachment in this post has been made obsolete; see below for details)

With fear and trembling, I submit this for anyone's testing pleasure. Use it at your own risk. No guarantees expressed or implied, etc., etc., and so forth. :)

Note carefully the following:

1. I am using a modified FLB 1.5/1.6a rom (meaning it a combination of those two roms with a bunch of other tweaks)

2. My a2sd is version 2.7.5 rc2

3. I modified both starta2sd and launcha2sd as best I could figure out what fibblesan meant. So starta2sd was modified in one place and launcha2sd was modified in two places

4. Prior to flashing this update, I ran the following commands in terminal (because I had previously set lowmem-moderate):

su

a2sd lowmem-default
5. I flashed the attached file using recovery mode (just the usual way of installing .zip updates). 6. I am using a Class 6 card with a 64 mb swap partition. 7. I often don't really know what I'm doing, but I have fun doing it anyway. :lol: 8. Please don't try to ask me any difficult questions; they just confuse me. :( :) After rebooting, this command...
cat /proc/sys/vm/swappiness

...returned a value of 15, as expected.

YMMV. YMMD. YAOYO. (your mileage may vary, your machine might die, you are on your own). :(

a2sdswappiness15_signed.zip Edit: fibblesan has released an update to his 2.1 rom (FLB 1.6b). That update now contains what I did here and more. So you should just use his update if you are interested. I will leave this here in the outside chance someone has some reason to want to look at it.

Edited by twrock
Link to comment
Share on other sites

Guest primo007
Please check again... Mbps = Megabits/sec. MBps = MegaBytes/sec.

So again: 16 megabits = 2 megaBytes.

Pretty sure you ain't gonna measure 15 megaBytes of reading and 5.5 megaBytes of writing your SD every second :lol:

Class number shows the writing speed, not the reading. So he could measure 15 megabytes of reading and 5.5 megabytes of writing which is a good class 4 or an average class 6 card.

Link to comment
Share on other sites

With fear and trembling, I submit this for anyone's testing pleasure. Use it at your own risk. No guarantees expressed or implied, etc., etc., and so forth. :)

Note carefully the following:

1. I am using a modified FLB 1.5/1.6a rom (meaning it a combination of those two roms with a bunch of other tweaks)

2. My a2sd is version 2.7.5 rc2

3. I modified both starta2sd and launcha2sd as best I could figure out what fibblesan meant. So starta2sd was modified in one place and launcha2sd was modified in two places

4. Prior to flashing this update, I ran the following commands in terminal (because I had previously set lowmem-moderate):

su

a2sd lowmem-default
5. I flashed the attached file using recovery mode (just the usual way of installing .zip updates). 6. I am using a Class 6 card with a 64 mb swap partition. 7. I often don't really know what I'm doing, but I have fun doing it anyway. :lol: 8. Please don't try to ask me any difficult questions; they just confuse me. :( :) After rebooting, this command...
cat /proc/sys/vm/swappiness

...returned a value of 15, as expected.

YMMV. YMMD. YAOYO. (your mileage may vary, your machine might die, you are on your own). :(

a2sdswappiness15_signed.zip

Are your settings working properly without any lags (e. g. while installing apps)?

Link to comment
Share on other sites

With swappiness @ 15 do you get the same results as with the lowmem-moderate?

With moderate you can run about 4 apps without lag. I am interested to see how it performs! (If they produce the same results then modifying the Swappiness would probably be the better method)

Link to comment
Share on other sites

Are you sure that swappiness adjust the "priority" of swap?

I noticed that with 15 swappiness it uses maximum 15MB of swap(128MB) no matter how many aps I start. Also with default swappiness it didn't used more than 60MB.

I think your performance improved because default swappiness was too high for 32Mb swap.

Link to comment
Share on other sites

Swappiness is a setting within the linux kernel that adjusts how "aggressive" the kernel will be at swapping things out from memory to the swap partition.

If you set the swappiness very low (0), then the kernel will tend to keep things in memory even if they haven't been used for a while. This results in very little free memory available, but very quick switches among running applications. However, since there is little free memory available, Android will tend to terminate apps (saving their state) if you try to run too many at once.

If you set the swappiness very high (100), then the kernel will tend to move things out of memory and into the swap file, even if they were just used a short time ago. This results in lots of free memory available, and slower switches among running applications (because they need to be brought back in to memory from the swap partition). Android itself would probably never need to terminate any apps, no matter how many you try to run.

What's best ? Somewhere in the middle will give a good trade-off. If you like to run just a few apps at a time, lower swappiness is better. If you like to run lots of apps at a time, then you might prefer a higher swappiness. Use a lower value if you have a slow card, or you are concerned about the card failing from overuse.

Are you sure that swappiness adjust the "priority" of swap?

I noticed that with 15 swappiness it uses maximum 15MB of swap(128MB) no matter how many aps I start. Also with default swappiness it didn't used more than 60MB.

I think your performance improved because default swappiness was too high for 32Mb swap.

Link to comment
Share on other sites

Are your settings working properly without any lags (e. g. while installing apps)?

Well....., I wish I could have a bunch of stuff to report, but I don't. :(

As always seems to happen with roms based on the UK update, my phone's cell connection stopped working this afternoon and I missed calls. It's a bug of some sort that I have not been able to sort out. Full connection bars, but no calls in or out. Frustrating. And for some reason, it doesn't seem to happen with my Tre-based rom.

So after my messing around to get swap working and stable (which it seemed to be for a few hours at least), I'm off of FLB 1.6a and back onto TWeak 0.3 (Tre2.1). Maybe if I have more time to experiment next weekend (or some evening this week), I can learn more. But I'm not hopeful. I need a phone that can receive and make calls more than I need a phone that can run a gazillion apps without lag. It is a cell phone after all. :lol:

However, I will encourage anyone who wants to experiment that modifying the starta2sd and launcha2sd is not that hard. After you do it once, it's simple just to change the values to something else.

Edit: If there is anyone out there with the know-how to drop this swap-enabled kernel into the modified (rooted and a2sd) Tre rom boot.img, I would really love to have that to work with. I'd like to learn how to do it myself, but there is a steep learning curve, and it's all I can do to try to learn how to work with this simple stuff. :)

Edited by twrock
Link to comment
Share on other sites

Edit: If there is anyone out there with the know-how to drop this swap-enabled kernel into the modified (rooted and a2sd) Tre rom boot.img, I would really love to have that to work with. I'd like to learn how to do it myself, but there is a steep learning curve, and it's all I can do to try to learn how to work with this simple stuff. :lol:

You will have to use the UK boot image. But the kernel will be the same as the Tre kernel.

Edited by flibblesan
Link to comment
Share on other sites

You will have to use the UK boot image. But the kernel will be the same as the Tre kernel.

:lol: (Laughing at myself.) See, right there just shows how much I don't understand. I'm not even sure what that means. :(

(Mostly musing to myself...)

Does boot image = boot.img? What is the difference between the two, and how does the kernel relate to each?

If I use the UK boot image, am I going to have exactly the same bug that I have now? What's the cause of this bug anyway? Why does it seem to only happen with the UK roms and not Tre?

Should I try again to build the rom I want based on UK2.1CCR, toss in the 2.6.29 swap-enabled boot.img and see if the same bug is there?

Well, it's too much for me at the moment anyway. I think I'll try to stick the TWeak 0.3 for at least this week (because at least it works) and consider it all again next weekend. Who knows, by then T-Mobile might have given us Froyo? :)

Link to comment
Share on other sites

:lol: (Laughing at myself.) See, right there just shows how much I don't understand. I'm not even sure what that means. :(

(Mostly musing to myself...)

Does boot image = boot.img? What is the difference between the two, and how does the kernel relate to each?

If I use the UK boot image, am I going to have exactly the same bug that I have now? What's the cause of this bug anyway? Why does it seem to only happen with the UK roms and not Tre?

Should I try again to build the rom I want based on UK2.1CCR, toss in the 2.6.29 swap-enabled boot.img and see if the same bug is there?

Well, it's too much for me at the moment anyway. I think I'll try to stick the TWeak 0.3 for at least this week (because at least it works) and consider it all again next weekend. Who knows, by then T-Mobile might have given us Froyo? :)

Yeah sorry. The boot.img is the boot image and contains the scripts and kernel needed to boot the phone. I've checked and there is no difference between the UK kernel and the Tre kernel, so you'll be able to use the same boot image. The only kernel that is different is the old Hungarian one.

Link to comment
Share on other sites

Yeah sorry. The boot.img is the boot image and contains the scripts and kernel needed to boot the phone. I've checked and there is no difference between the UK kernel and the Tre kernel, so you'll be able to use the same boot image. The only kernel that is different is the old Hungarian one.

Wow, really?!!! It's that simple?

I had tried that (using fastboot to flash the 2.6.29 boot.img you uploaded), but I was afraid I would really screw something up, so I stopped using it. But if they really are the same, that makes my life a whole lot easier. (Well, maybe "life" is a little bit of an overstatement.....)

Thanks much. I'm off to experiment with a new rom!

Link to comment
Share on other sites

Yeah sorry. The boot.img is the boot image and contains the scripts and kernel needed to boot the phone. I've checked and there is no difference between the UK kernel and the Tre kernel, so you'll be able to use the same boot image. The only kernel that is different is the old Hungarian one.

So wait, by this u mean I can flash the modified kernel to a flb1.2 for example?

Cause u said from 1.3 and up back then and I haven't checked for updates since cause I was a little busy.

Link to comment
Share on other sites

Wow, really?!!! It's that simple?

Well, I should have known nothing is that easy. :lol:

Even with initial experimentation, I can't get Apps2SD 2.7.5 final and that 2.6.29 boot.img to play nice together on top of the modified Tre rom. It works with one or the other, but not both.

So far all I've been doing is trying to see if I can flash both of the .zip updates (in every possible order I can think of) onto the Tre rom and get something working. Hangs every time at the first Android splash screen.

Is there some obvious reason why those two won't cooperate?

(Maybe it's time to start a new thread.)

Link to comment
Share on other sites

Guest Markus Arnold

I just bought a class 6 sd card and wanted to use swap but i'm not really sure if i got it right what i have to do.

At the moment i am using a2sd (rom: FLB 1.6b) with a class2 card, so can i keep all my apps if i use the ("su"+) "a2sd remove" command before i change the cards?

I have an idea what to do, hope you guys can confirm my steps: (not sure if i gut the owners guide correct)

- partition the sd with clockwork recovery

- swap partition: 64 or 128 mb ? (with class 6 sd and i plan to usw a2sd as well), ext2: 512mb

-reboot

-terminal:

- su

- a2sd reinstall

- a2sd reswap

- a2sd lowmem-moderate (Do i need that command now with FLB 1.6b?)

How can i change the swappiness factor? What factor should i set?

Do i need the Autokiller app? Whats the difference to the a2sd lowmem-command?

Hope u guys can provide some answers. Cheers!

Link to comment
Share on other sites

Guest de_shepherd
I just bought a class 6 sd card and wanted to use swap but i'm not really sure if i got it right what i have to do.

Might be interesting if you downloaded the SD card speedtest app from the market and reported the results for the class 2 and class 6 cards .... I've a class 2 card which is reported as being much faster by this test so it would be interesting to get a direct comparison between what it reports a class 2 and a class 6 as achieving.

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.