[G1 Android Development] ttabbal:
OK, swap info.

Swap, properly tuned, is a GOOD thing for any modern OS. It allows the OS kernel to push unused/less used data and code to slower storage for later use, freeing up fast RAM for your programs and data that you ARE using. The trick is to avoid swap thrashing. IMO, the kernel default for swappiness (60) is way too high for a phone. It's good for a desktop, which makes sense as that's what it was set up for. I run 20 swappniess and have not had any thrashing with it. I also run AutoKiller, which is, IMO, almost necessary for Android to play nicely with swap.

As for size, don't go nuts. If you keep swappniess low, and use AutoKiller, you won't use all that much anyway. My partition is currently 40MB. I had 128MB, but decided to try lowering it as "free" was reporting that it rarely used over ~24MB with my settings. I just left unused space at the end of the card, that way I can expand the partition without affecting the FAT32 and ext4 partitions. :D

As for wear on the SD... Really? First, wear leveling will prevent the worst of the problems. There's also the fact that only some of the cells will get damaged. It's not like most hard drives where you are likely lose the whole disk, you're more likely to have some cells become read-only than anything else. Not really a big deal. And even if you do end up trashing the card, so what? An 8GB class 6 is what, $15 now? Stop being such a cheap ass. :D For those that will now ***** about data loss, you should be backing up the important data from your card. If you're not, it's nobody's fault but yours. EVERY data storage device will fail eventually. The only way to avoid losing data is to have multiple copies. So start backing up your stuff. The phone came with a USB cable, that's enough to get the important stuff. I even have a gscript to back up the stuff on the ext partition that I want over to the FAT32 so I can easily copy it off with USB, or even Bluetooth. I put a bunch of scripts and such over there, most people probably only have apps and dalvik-cache on it, so don't need to worry about it.

Personally, I don't like compcache much. It sucks up CPU cycles I'm already short on for compression/de-compression. If you keep the amount of data in there low, the speed of the SD isn't really a big deal.

The other thing it seems to help with is the stupid web browser. The browser doesn't seem to use the SD for it's cache, instead using RAM. Swap helps push that data out the SD where it belongs and gives the browser a little more room to store stuff locally so it doesn't have to download it again. That helps a LOT with speed. While SD is certainly slow compared to RAM, it's amazingly fast compared to the internet. :D

Finally, get over the idea that there is a "one size fits all" setup. How well it works will depend on your workload. What apps you run, what they do, etc.. This is probably why some people have good experience while others don't. And if you aren't willing to experiment a little, just forget it exists and don't use it. The swapper app isn't a bad way to go for people that don't want to mess with the script files. Personally, I prefer the scripts, but I've been running Linux systems for years. Also, use a partition. A file on the FAT32 is dangerous. If the system goes down while it's writing to the swap file, it could damage the FAT tables and you will lose all the data on that partition. The swap partition is a far better way to go. It will also likely perform better as there's no filesystem code involved.