[G1 Android Development] ttabbal:
Interesting that by any reasonable measure, you are wrong here. :D

My phone has a 40MB swap set up. It tops out using about 24MB of that. I can start every program on my phone in succession, and I have a fair number, and it will stay there. If I check "ps" or "top", I can see apps getting killed. I can also see the messages in logcat showing the apps getting asked to close. Which is exactly what I suggested would happen based on reading the kernel source. And yes, I just tested this with logcat, ps, and top running on my computer via adb so I can see things happening. Using "free" shows the swap use go up to handle the spike of me launching apps constantly, then down as the process killer goes through and kills older ones. Performance using the phone remains constant through this test. I will say that if you have more RAM than you know what to do with, you don't need swap. That's not the case for our phones, at least it's not for me. Maybe you have more RAM than I do? :D Yes, performance with swap is lower than without. However, I can run background apps that actually stay running with swap and I can't without. And the performance hit is minimal, even after loading about 100 apps and letting Android kill them. This is reality I'm talking about, right here on my personal G1 running CM5.0.7-test3. No amount of rude spouting off by some random guy on the internet is going to change the reality of testing on my personal device.

With Linux and Windows, the systems I know swap best on, your understanding of swap is wrong, or at least incomplete. On Linux, this is based on reading the kernel source and reading LKML. On Windows, it's based on reading Microsoft documentation, as that's the best source I can find. They certainly don't give me access to their source. Swap doesn't stay empty on either of those systems, yet they run fine. Swap has perfectly valid uses that are not simply "extending memory" and it can help make systems run better by putting memory that isn't being used to the best of it's ability to better use. For example, some large applications might have a bunch of code that is only ever referenced on initialization. Keeping that in RAM is wasteful and prevents the kernel from using that RAM for another application or for disk cache. Things that would make your programs run faster overall. If the kernel swaps that code out, it can make room for those other things. I know for a fact that the Linux kernel does this sort of thing, and I have it on good authority that the current Windows kernel does as well. Android's process killer doesn't effect this behavior.

I love that you come in here and threadcrap over something that doesn't effect you. If people want to look into swap, we have told them how. We have also mentioned the up and down sides to swap reasonably well, IMO. What difference is it to you if some people find swap useful? It's not like anyone is trying to force you to run it on your phone. It's a tool, and a useful one. Like any tool, you can use it to hurt yourself or help yourself. The idea in this thread is to attempt to help people that want to try it out by providing them with information about what swap is and how to configure it on a Linux system. After that, they can choose for themselves. I don't really care if people use it or not, I'm just trying to provide information on how to use it and pointers to ways to tune it to match their specific workload.

I think I'm done feeding the troll. I'll continue to help people with questions in this thread though.