How do I know linux-swap is working? - G1 Q&A, Help & Troubleshooting

I set it all up forever ago, but thought nothing of it.

Not sure what you're asking, but opening a terminal and type "free" should tell you if swap is enabled/used.

I see ers mem and the 584 swap... wish I could understand the numbers that show up better (seems like there should be more free to me).
I had 2732 free memory and 8968 swap.
what other cool things can I find out in Terminal (like by typing in "free").

s15274n said:
I see ers mem and the 584 swap... wish I could understand the numbers that show up better (seems like there should be more free to me).
I had 2732 free memory and 8968 swap.
what other cool things can I find out in Terminal (like by typing in "free").
Click to expand...
Click to collapse
df shows the amount of memory used in each of the system's partitions
Type "busybox" to see busybox commands, then type one of those commands to find out what it does

Well I entered 'free' in terminal emulator, and there's what I got
$ su
# free
total used free shared buffers
Mem: 97916 96364 1552 0 292
Swap: 0 0 0
Total: 97916 96364 1552
So does this mean it's NOT working?

Yep, its not working.
phuKKah said:
So does this mean it's NOT working?
Click to expand...
Click to collapse
Yep, its not working.
Download swapper from the market, its the simplest and quick way to get it working.
Hth

Swapper worked
anyone know recommendations about swap sizes? like what size is good for what kind of use? I can go from there
Edit: I meant swappiness

phuKKah said:
Swapper worked
anyone know recommendations about swap sizes? like what size is good for what kind of use? I can go from there
Edit: I meant swappiness
Click to expand...
Click to collapse
personally I find higher swappiness is better.
currently running CM 4.2.8.1 w/ 132MB swap partition + 10MB CC mem_limit and swappiness of 100. Runs great.

On Linux env I remember (coudl be wrong) swap should be 1/4 your ram, dunno if being more it's worse. So 64k should be enough.
Personally I've found 96k swap and swappines 40 the right balance.

gdbjoe said:
On Linux env I remember (coudl be wrong) swap should be 1/4 your ram, dunno if being more it's worse. So 64k should be enough.
Personally I've found 96k swap and swappines 40 the right balance.
Click to expand...
Click to collapse
Weird, because on Windows it's supposed to be 1.5-2 times your RAM o.0

could you please explain what linux-swap is and these terms swippiness and swap

asb123 said:
could you please explain what linux-swap is and these terms swippiness and swap
Click to expand...
Click to collapse
Chances are that if you don't know about it, then you don't need it
However, it is just a partition on your sdcard that the phone uses for memory. This is mostly used on hero roms where the phone doesn't have enough memory to have all of its functions on at once. Swappiness is the percent that the system uses that partition as memory (i.e. If swappiness is at 80 then it will use the partition 80% of the time and phone memory 20% of the time

JAguirre1231 said:
Chances are that if you don't know about it, then you don't need it
However, it is just a partition on your sdcard that the phone uses for memory. This is mostly used on hero roms where the phone doesn't have enough memory to have all of its functions on at once. Swappiness is the percent that the system uses that partition as memory (i.e. If swappiness is at 80 then it will use the partition 80% of the time and phone memory 20% of the time
Click to expand...
Click to collapse
I c , thanks for the explaination. You are right now that i know what it does i dont think i need it as i will not be running hero.

asb123 said:
I c , thanks for the explaination. You are right now that i know what it does i dont think i need it as i will not be running hero.
Click to expand...
Click to collapse
it's always nice to have. For example, when you launch the browser after, say, viewing an email, the last session would have been cached so you won't have to reload the page.

gonintendo said:
it's always nice to have. For example, when you launch the browser after, say, viewing an email, the last session would have been cached so you won't have to reload the page.
Click to expand...
Click to collapse
wait, this phone does not support this feature normally but does with this mod?

im rooted with cyanogen 4.2.14..(just below the latest version) and i cant get my swap to turn on...cant find swapper on market...can anyone give me a link to the apk file...i did the 10mb ram hack but still fone is slow...if i cud only get the swap on

mehdiharoon said:
im rooted with cyanogen 4.2.14..(just below the latest version) and i cant get my swap to turn on...cant find swapper on market...can anyone give me a link to the apk file...i did the 10mb ram hack but still fone is slow...if i cud only get the swap on
Click to expand...
Click to collapse
In the time it took you to type this you post this you could have went to google and typed "swapper for android" and you could have found it yourself. Since I'm not a complete asshole I will give you the link http://code.google.com/p/a-swapper/

Related

Compcache or linux-swap partition

Ok so i am running Cyan's 3.6.8.1 currently. I was running the newest 7 up untill this morning. And i woke up and booted my phone and had extreme lag. Restarted, had some bad lag still. I checked my swap and it said 0 across the board. I cant remember checking it with a fresh install. So my question is:
Does swap partition work with the most recent cyanogens? Also i keep seeing stuff pop up about compcache, ive read the tutorial but it looks like there isnt a recent userinit.sh for the newest cyan rom. How much faster is compcache if any over the swap partition?
I may be wrong but ithink the difference is one is dumped on sdcard (swap) and the other internally (compcache). Thaty means a slower sd card would result in slower read/write times. Also giving more wear on the sd. The userinit posted should be fine with cyanogens newest, however swappiness seems to be set a little high (60) that is a endless debate for the perfect setting. Mine is set to 10 though.
I have been reading some conflicting posts over which is better (linux swap vs compcache). Having used compcache for a week now, I am not happy with it--my swappiness was originally set at 60 and is now at 20. Some are saying that the linux swap allows their phones to operate very quickly and smoothly, which is unfortunately not the case with my phone. Add the confusion that there is a solution involving compcache with a backing swap file, and things look really complicated.
Also, I actually saw a poster claiming that NO SWAP worked better than having a swap at all. If anyone has some real data, please tell us: 1) whether swap increases phone performance (and how), and 2) which swap (linux, compcache, or compcache with backing swap) is better.
Thanks!
derfolo said:
I have been reading some conflicting posts over which is better (linux swap vs compcache). Having used compcache for a week now, I am not happy with it--my swappiness was originally set at 60 and is now at 20. Some are saying that the linux swap allows their phones to operate very quickly and smoothly, which is unfortunately not the case with my phone. Add the confusion that there is a solution involving compcache with a backing swap file, and things look really complicated.
Also, I actually saw a poster claiming that NO SWAP worked better than having a swap at all. If anyone has some real data, please tell us: 1) whether swap increases phone performance (and how), and 2) which swap (linux, compcache, or compcache with backing swap) is better.
Thanks!
Click to expand...
Click to collapse
Compcache with backing swap uses both compcache and the linux swap partition (or a regular swap file). Because this uses both methods, this would be fastest. Its actually made the JACHero ROMs ridiculously usable (compared to before anyways...). The swappiness doesn't matter, it just determines how often android will use compcache or linux-swap. It differs from build to build, each build will have an optimal setting.
Linux-swap is faster than regular swap file.
I don't have any data, but testimonial(ly?) when I use JACHero with vs without compcache and linux-swap is like night and day. Without it, the phone is unusable, with it, the phone is very much improved.
Kind of off topic, but how do i change the size of the compcache file?
cronin4392 said:
Kind of off topic, but how do i change the size of the compcache file?
Click to expand...
Click to collapse
Edit the userinit.sh file you're using. Check the proper threads for compcache in development forums.
As far as Compcache vs swap, I've gone back to no swaps, it seems snappier by itself without these methods. It could be a personal preference though depending on what apps/services you use the most.

question about formatting and apps2sd

okay i just formatted my sd and i put 1g of memory on the swap and ex2, thats taking up 2g outa my 4g. does anything save on the swap? im just wondering this because i wanna free up as much memory as i can for saving pictures and music.
None of the roms out at the moment use the swap partition.. and the ext2 partition is for apps2sd.. I use 512 ext2 but no one needs that much. And swap you can set at 0 until the roms use it.
Hope this helps.
Redneck101 said:
okay i just formatted my sd and i put 1g of memory on the swap and ex2, thats taking up 2g outa my 4g. does anything save on the swap? im just wondering this because i wanna free up as much memory as i can for saving pictures and music.
Click to expand...
Click to collapse
You had no reason to change anything from the defaults. Go back and re-do it.
Redneck101 said:
okay i just formatted my sd and i put 1g of memory on the swap and ex2, thats taking up 2g outa my 4g. does anything save on the swap? im just wondering this because i wanna free up as much memory as i can for saving pictures and music.
Click to expand...
Click to collapse
Swap file will not be usable until we get Source code for the kernel. SWAP = Linux version of a page file. = Hard Drive based RAM. Kind useless on a phone. I doubt it will make leaps and bounds of difference when we actually get it. You can set swap to 0 and apps to 512. If you use more than 512 for apps, you are a pack rat and probably cant find anything and don't use what you have IMHO.
Kcarpenter said:
Swap file will not be usable until we get Source code for the kernel.
Click to expand...
Click to collapse
Uh. no. Swap works now. There's even an application on the market that will set it up for you, as long as you have the swap partition on your sdcard. Allows you to enable and disable it, and so on. It's not hard to set it up, then adb into the phone and verify it's actually doing something.
SWAP = Linux version of a page file. = Hard Drive based RAM.
Click to expand...
Click to collapse
No, not really. Swap is not additive to your real RAM.
Kind useless on a phone. I doubt it will make leaps and bounds of difference when we actually get it.
Click to expand...
Click to collapse
Depends. Having swap enhances memory management, as it allows you to page stuff out of *real* RAM when it's not in use, and only bring it back when a page fault forces you to. It can also really beat you up, if memory pressure is forcing so many faults that the kernel spends all its time moving memory around instead of allowing processes to actually run.
You can set swap to 0 and apps to 512. If you use more than 512 for apps, you are a pack rat and probably cant find anything and don't use what you have IMHO.
Click to expand...
Click to collapse
Additionally, even applications installed to the sdcard use SOME space in /data. You'll overrun the filesystem in the phone before you overrun a 512 mb partition.

Making g1 run faster? (10 mb hack)

Hi, I was wondering if I can use the 10 mb ram hack with my g1 with CM 6.0 RC2. I noticed most of the tutoriials are using 4.xx.xx so I wanted to ask before I do it. My phone is kind of slow even though it is overclocked at 576mhz and 64 mb class 6 memory swap. Thanks.
Ties0 said:
Hi, I was wondering if I can use the 10 mb ram hack with my g1 with CM 6.0 RC2. I noticed most of the tutoriials are using 4.xx.xx so I wanted to ask before I do it. My phone is kind of slow even though it is overclocked at 576mhz and 64 mb class 6 memory swap. Thanks.
Click to expand...
Click to collapse
There is no 10 mb hack and won't be. It is not possible with Froyo.
As indicated above there is no 10mb hack and there never will be.
I am currently using the latest nightly and it is super fast and stable. As fast as donut (no ****).
3D Gallery works perfectly and there have been a bunch of small cool features added to the nightly.
I highly recommend it.
Awesome work has been done by Cyanogen and Crew.
ok thanks for the reply guys. Is there any other way to make my rom faster? Thanks.
Ties0 said:
ok thanks for the reply guys. Is there any other way to make my rom faster? Thanks.
Click to expand...
Click to collapse
Of course reduce or remove swap,
android has it's own swap mechanism that causes little ram to actually be least recently used, thus if swap is enabled the phone will be constantly swapping it in/out!
In addition to reducing the life of the SD card its slow. I understand a very little bit of swap *may* allow some edge cases where a *little* more ram is needed or to offload something like launcher that may be configured to stay in ram to work faster.. however you can't forget the speed issue.
Try this enter console on your phone and run:
dd if=/dev/zero of=/sdcard/swapspeedtest bs=1048576 of=64
Note the time it takes, that is the time to write 64mb on a swap out operation.. if it seems too long to wait for a task its too much swap. 12mb is almost acceptable. I just stick to comp cache only. . Upped it from the default 12 to 15 MB since I had one or two tasks that just needed a tad more memory to play nice.
Also what is slow, returning to home? A particular app? I doubt its everything, usually its launcher and there are ways of locking it in home, upgrades to awd, and alternative launchers. These may help.
ezterry said:
Of course reduce or remove swap,
android has it's own swap mechanism that causes little ram to actually be least used, thus if swap is enabled the phone will be constantly swapping it in/out
In addition to reducing the life of the SD card its slow. I understand a very little bit of swap to allow some edge cases where a little more ram is needed or to offload something like launcher that may be configured to stay in ram.. however you can't forget the speed issue.
Try this enter console on your phone and run:
dd if=/dev/zero of=/sdcard/swapspeedtest bs=1048576 of=64
Note the time it takes, that is the time to write 64mb on a swap out operation.. if it seems too long to wait for a task its too much swap. 12mb is almost acceptable. I just stick to comp cache only. . Upped it from the default 12 to 15 MB since I had one or two tasks that just needed a tad more memory yo play nice.
Also what is slow, returning to home? A particular app? I doubt its everything, usually its launcher and there are ways of locking it in home, upgrades to awd, and alternative launchers. These may help.
Click to expand...
Click to collapse
Thanks for the detailed response! I will try lowering the swap partition, I always thought it would be fast because of the class 6 speeds. Does putting all my apps on SD make it slow as well? Also, returning to home is the main lag I'm talking about as it takes quite a while to see my apps. Thank you!
ezterry said:
Of course reduce or remove swap,
android has it's own swap mechanism that causes little ram to actually be least used, thus if swap is enabled the phone will be constantly swapping it in/out
In addition to reducing the life of the SD card its slow. I understand a very little bit of swap to allow some edge cases where a little more ram is needed or to offload something like launcher that may be configured to stay in ram.. however you can't forget the speed issue.
Try this enter console on your phone and run:
dd if=/dev/zero of=/sdcard/swapspeedtest bs=1048576 of=64
Note the time it takes, that is the time to write 64mb on a swap out operation.. if it seems too long to wait for a task its too much swap. 12mb is almost acceptable. I just stick to comp cache only. . Upped it from the default 12 to 15 MB since I had one or two tasks that just needed a tad more memory yo play nice.
Also what is slow, returning to home? A particular app? I doubt its everything, usually its launcher and there are ways of locking it in home, upgrades to awd, and alternative launchers. These may help.
Click to expand...
Click to collapse
I have about 3-5 apps that I would like to be running at one time? Should I be using CompCache or Swap? Currently I am on SuperD 1.9.3 WGK. I have been reluctant to run Froyo roms because they are so much more memory hungry in my experiences. My current rom runs pretty fast with a 96mb swap. If I were to fun a Froyo rom, what can I do to be able to run the 3-5 apps and retain speed?
Ties0 said:
Thanks for the detailed response! I will try lowering the swap partition, I always thought it would be fast because of the class 6 speeds. Does putting all my apps on SD make it slow as well? Also, returning to home is the main lag I'm talking about as it takes quite a while to see my apps. Thank you!
Click to expand...
Click to collapse
If you are using BOTH SWAP & have applications installed to the sdcard, then it will ****REALLY**** be slow.
With just applications on the sdcard, your speed should be fine.
Ties0 said:
Also, returning to home is the main lag I'm talking about as it takes quite a while to see my apps. Thank you!
Click to expand...
Click to collapse
This is a symptom of launcher being evicted from ram, try the stay in ram option in settings->adw launcher->system settings->system persistent in the more recent versions of adequate (I think included with rc2 if my memory serves me)
It may not be perfect as it will still get killed if a very large application is loaded.
Either you need a launcher that behaves as a good android application, and can quickly reload it's last state, even if it was not in ram when you requested it.. or launcher needs to be considered outside the usual android memory management and to be kept in ram.
These persistent processes are where you may depending on your usage of the phone find comp cache or swap in low amounts (32mb combined is probably the absolute max) may help as they will have allocated ram that is rarely used and not automatically freed as they are persistent..
ezterry said:
This is a symptom of launcher being evicted from ram, try the stay in ram option in settings->adw launcher->system settings->system persistent in the more recent versions of adequate (I think included with rc2 if my memory serves me)
It may not be perfect as it will still get killed if a very large application is loaded.
Either you need a launcher that behaves as a good android application, and can quickly reload it's last state, even if it was not in ram when you requested it.. or launcher needs to be considered outside the usual android memory management and to be kept in ram.
These persistent processes are where you may depending on your usage of the phone find comp cache or swap in low amounts (32mb combined is probably the absolute max) may help as they will have allocated ram that is rarely used and not automatically freed as they are persistent..
Click to expand...
Click to collapse
Thanks for the detailed response! I just changed the adw launcher and deleted my swap partition... It seems to be much slower when pressing home (icons are taking a while to load) so I might just use 32 mb for swap.
EDIT: question, what exactly does ext4 do? I know swap is like external ram, but what does ext4/ext3/etc exactly do? and how much should I put in? I tried googling but could not find the answer. Thanks!
Ties0 said:
EDIT: question, what exactly does ext4 do? I know swap is like external ram, but what does ext4/ext3/etc exactly do? and how much should I put in? I tried googling but could not find the answer. Thanks!
Click to expand...
Click to collapse
On CM6, nothing. On CM 4 & 5, it was used for Apps2Ext (formerly known as Apps2SD - before Google came out with their own flavor). However, CM6 does not have Apps2Ext. It has been indicated that it will be targeted for 6.1.

[Q] Ginger Yoshi installing 41%CC hack questions.

Hi all,
For my dream Yoshi is asking during install:
Code:
install 41% CC hack, or install 60mb swap.
I selected the 41% option,
Now I am wondering if that was the right one.
Heeter
Heeter said:
Hi all,
For my dream Yoshi is asking during install:
Code:
install 41% CC hack, or install 60mb swap.
I selected the 41% option,
Now I am wondering if that was the right one.
Heeter
Click to expand...
Click to collapse
probably not
that is a huge chunk of memory to be wasting
compcache takes a proportion of physical memory, compresses it and uses it as a swap device. The benefit of this is that it is faster than normal swap.. your device thinks its got more memory than it has so apps will stay alive longer
but the price you pay is the memory is slower apps don't get killed and clutter up memory and eventually you slow to a crawl because every pointless little app is sitting in swap
the 41% value means 41% of your ram is being compressed and used as the swap space
which is very high.
you should be able to just change the compcache in the cyanogen settings
but don't take my word for cc being a bad idea
I just have the point of view that I would prefer my phone have a few key processes running well than having lots processes running badly
but what is worse is you can tell the rom is just a ripoff because it is very easy to add the higher options prior to compiling , it is just a case of adding a few strings to some xml files, no need for hacks.
Very nice thanks
Effdee said:
probably not
that is a huge chunk of memory to be wasting
compcache takes a proportion of physical memory, compresses it and uses it as a swap device. The benefit of this is that it is faster than normal swap.. your device thinks its got more memory than it has so apps will stay alive longer
but the price you pay is the memory is slower apps don't get killed and clutter up memory and eventually you slow to a crawl because every pointless little app is sitting in swap
the 41% value means 41% of your ram is being compressed and used as the swap space
which is very high.
you should be able to just change the compcache in the cyanogen settings
but don't take my word for cc being a bad idea
I just have the point of view that I would prefer my phone have a few key processes running well than having lots processes running badly
but what is worse is you can tell the rom is just a ripoff because it is very easy to add the higher options prior to compiling , it is just a case of adding a few strings to some xml files, no need for hacks.
Click to expand...
Click to collapse
thanx for clearin on cc!
goin back from mt4gslide ==>mt3g dam ))

[Q] Would enabling swap boost real world performance?

I'm interested in any real world experiences of people using a swap partition on the SD card or similar solutions. I mostly see guides about how you enable swap, which isn't that hard, but any quantifiable or subjective reports of improved performance is lacking.
My only experience using swap was using an openwrt router (with very limited resources) where it was vital for some stuff to function at all, but I couldn't see any general speed improvements, and when swap was used it was terribly slow.
Do you use swap or tried it, does it help? How much?
PremiumMediocre said:
Do you use swap or tried it, does it help? How much?
Click to expand...
Click to collapse
Apparently this is not something that interest people, but in case someone searches for swap and finds this post I can say it definitely helps with multitasking. Currently my phone uses over 100MB of swap space, and lags due to apps being terminated due to low memory is a more rare occurrence nowadays.
Just some interesting reading about this:
http://zerocredibility.wordpress.com/2009/08/24/why-android-swap-doesnt-make-sense/
http://android.stackexchange.com/questions/2310/how-will-a-swap-partition-file-affect-the-system
If you're still interested, read these two links. A bit old though, but the only difference might be that Google has put an effort into making Android's way of freeing memory better. In that case, from what they say, I'd say there's a chance that swap will increase your performance.
Thank you, I've been reading up on swap as well, and it's not completely clear cut.
From your first link the argument:
"Having swap actually prevents the native Android memory management scheme from activating. The system sees memory and doesn't distinguish between physical and virtual. It will therefore prefer swap over the native Android memory management scheme, and won’t activate the native scheme until swap is full."
I believe this is just plain inaccurate. Even if you set swappiness to 100 android will terminate apps without filling the swap space, and swap is never treated as plain ram as far as I know.
Some real benchmarks is sourly needed though.
PremiumMediocre said:
Thank you, I've been reading up on swap as well, and it's not completely clear cut.
From your first link the argument:
"Having swap actually prevents the native Android memory management scheme from activating. The system sees memory and doesn't distinguish between physical and virtual. It will therefore prefer swap over the native Android memory management scheme, and won’t activate the native scheme until swap is full."
I believe this is just plain inaccurate. Even if you set swappiness to 100 android will terminate apps without filling the swap space, and swap is never treated as plain ram as far as I know.
Some real benchmarks is sourly needed though.
Click to expand...
Click to collapse
I tried to find done benchmarks, but it seems like there are none...
And like I said, old links so Google might have done something about the issues they're talking about
Sent from my Incredible S using xda app-developers app
Also have a look in the desire Z section for this. They only have 512mb ram (we have 768) so they are always looking for ways to free up ram
There is a lot of discussion about swap so have a look there They might know a lot more compared with us
markj338 said:
Also have a look in the desire Z section for this. They only have 512mb ram (we have 768) so they are always looking for ways to free up ram
There is a lot of discussion about swap so have a look there They might know a lot more compared with us
Click to expand...
Click to collapse
I think the speed of the processor is also important in this context since the native way to save memory is letting programs recreate the last state they were in before they were shut down. A fast processor would make swap less attractive.
In case you anyone wants to try, I'm using the Hunterwu kernel and used swapper 2 to activate the swap partition. The only hang up setting it up was that swapper 2 identified the wrong partition as swap but that could be manually changed.
PremiumMediocre said:
I think the speed of the processor is also important in this context since the native way to save memory is letting programs recreate the last state they were in before they were shut down. A fast processor would make swap less attractive.
In case you anyone wants to try, I'm using the Hunterwu kernel and used swapper 2 to activate the swap partition. The only hang up setting it up was that swapper 2 identified the wrong partition as swap but that could be manually changed.
Click to expand...
Click to collapse
Tell us if its any better, I might do the same

Categories

Resources