NOTE: This article does not teaches how to Jailbreak your iPhone nor how to install Cydia an its apps. There are plenty of info on that out there. Please do not insist.
NOTE: As pointed by Robert, the amount of I/O generated by the swapfile may greatly decrease the iPhone’s SSD lifetime since is designed to be more at rest.
After buying an iPhone 2G from a friend I just couldn’t resists and started hacking all that I could. Put on the latest firmware by the time (3.1.3) and Jailbroke it, put on Saurik‘s Cycorder via Cydia (aptw repository) (also from Saurik) in order to gain movie recording ability but didn’t went any further than that.
Then, as I don’t have a 3G/EDGE plan on my carrier, I decided only to access internet over WiFI but even scrambling APN credentials my little buddy kept connecting to my carrier EDGE network (and thus spending my money on high taxes).
After reading a while I discovered that SBSSettings would give me the option to control EDGE status (enabled/disabled) instead of just jamming credentials (that were being ignored by the carrier anyway). Installed and it just worked like a charm…. BUT… I’ve noticed that my Spingboard page transitions became a little hangy and apps opening and closing started to take much longer than it usual. From SBSSettings pane, I constantly see my memory running out due to iPhone’s lack of memory and lots of apps in background struggling for resources.

Some apps are constantly running on background since boot: the Phone app (obviously) and the Mail app. I had to go often to the SBSSettings’ process manager and shut down Safari or iPod app when they insisted in being kept alive even after being closed thus still consuming my precious resources. The “Free Memory” tool from SBSSettings also helped a (tiny [micro]) little bit.
SBSSettings is your nerdy fat friend
After some researching on iPhone speed issues I’ve found that SBSSettings, just eats tons of memory from the device. This got some discussion because someone on behalf of BigBoss commented on a post on the same blog saying that SBSSettings did not ran in background, instead it would use some Springboard hooks that would activate the app when triggered and then destroyed the app instance when closed.
Actually SBSettings does not run in the background (which I believe is the whole premise of this article). Instead, it hooks springboard functions. When certain events inside springboard occur, springboard (which is a single process already running without sbsettings installed) causes the sbsettings window to open. When you close the window, it goes back to being idle again. It uses about 1mb of memory to exist but does not run in the background, does not slow the device down, and does not cause performance issues. It would be very nice if some research could be done before posting these sorts of articles :(
some commenter entitled on behalf of BigBoss
Well, I decided that I didn’t want to write (or think) on things based on assumptions so I decided to take a look further into my device system, logged on by SSH and ran a top command (had to install the “Top” app from Cydia) and there he was:

So it is, in some kind of way, running on background on my iPhone since the SBSSettings tab wasn’t open.
Proposed workaround
The proposed workaround is to install BossPrefs (even not supporting WIFI toggling by its interface on the 3.0 firmware) that is SBSSettings “father” (where it derived from it) and is quite being discontinued by BigBoss. I haven’t tried that yet because I’m still tied emotionally with SBSSettings even with the speed issue.
Even more heavy crap stuff
As if I hadn’t enough problems, I also have installed Veency (for VNCw support) and OpenSSH (for SSH support! RAH) and they just goes background and eat memory (and battery) as well.
Well, I benefit from SSH and Veency. From SSH because I’m an unix freak and like the lovely smell of an embedded shell under a *nix kernel. Besides syncing my iPhone wirelessly is convenient too. Veency is nice to read SMS messages, view notes or monitor any app from distance, for example: Working on your desktop/laptop computer and having the cellphone on your pocket or far from the table (I’m not lazy I just like connecting remotely to stuff!). They didn’t quite handle much trouble to memory because SBSSettings toggle buttons permit me to shut’em down and up whenever needed. It also keep my battery from draining unnecessarily.
Now THAT’s heavy, baby!
Going further down I managed to install Winterboard (also via Cydia) since I like custom themed things – just like Hell Angel’s likes custom bikes – that also runs backgrounded and thus handling the same side effects. That really lagged stuff out too.
Then I noticed things started to get very laggy, but the hell, I NEED (ok, maybe I don’t) those awesomeness! SBSSettings just give me fine control over my device. But I had to choose: look’n'feel + control or performance.
I really love all that Cydia awesomeness and when I was almost removing Winterboard, SBSSettings and such, I remembered that I’ve heard in some article that Apple didn’t allowed 3rd-party apps to be put in background because “it would drain the battery and the short iPhone memory (128M)” that struggles to support the Phone, and iPod app that are natively always running on background. So if I won’t reduce the number of backgrounded apps, the only thing left is to get more memory but, how?
I can’t solder more RAM, that would be too way extreme. Then it snapped the sysamin insde me and though that the memory issue could be aided with a swap/page file (virtual memory) but it wasn’t implemented natively on device (I believe in behalf of the type of Flash Memory on the device that lacks on read/write speed). But what the hell, why not?
Dynamic paging
Searching the internet I’ve found this forum topic on modmyi.com that discussed the implementation of swap file (dynamic paging) on the device and, guess what, they did it. It’s a single plist file and we get a sensible less lagging and gagging.
I just moved the plist file on the device over ssh and rebooted. It’s working quite better than before, so I don’t need to thrash my goods so soon.

I forgot to measure my iPhone load values before enabling dynamic paging (shame on me) to compare the gains so if anyone has some, please share on the comments! Hope this works for you as well as it worked for me! Do you have any other performance tips?
This does work but it shortens the life of the ssd. From what I’ve heard you can kill your 20 year ssd to 1 yearDepends on how heavy you are and what you do on it
Robert
June 18, 2010 at 8:37 pm
You’re right Robert.
iPhone’s SSD is not built to that frequent I/O and doing this may decrecrease expected lifetime. I dunno if your decrease scale is right but it sure stress the SSD. I’ll update the post, thank for the note!
Jan Seidl
June 21, 2010 at 1:11 pm