RSS

Improve iPhone 3g performance by Enabling Swapping (updated)

update: After 24hours, I’m pretty sure it helped quite a bit. My phone did not slow down to a crawl today nor did iOS start killing my fast app switching backgrounded apps. Will it last? Will it blend? Of course not, it’s VIRTUAL memory!

With the latest iOS 4 supporting multitasking or with any other version of iOS that has been set free from its jail, I’ve noticed that my old, slow iPhone 3g has been having memory issues.

With iOS 3 and multitasking applications such as backgrounder, I could at least manage what app I wanted to leave open in the background. Sure, it took more CPU but at least I could manage it.

With iOS 4 (multitasking enabled using the latest pwnagetools) – many apps will keep using RAM in the background if they support Fast App Switching. As more and more apps get recompiled with iOS 4 and fast app switching enabled, I noticed I needed to reboot my iPhone from time to time or manually close these apps. And as we know, task managers, blowing it, etc…

Here is how I enabled swapping on my iPhone – sorry for not quoting any definite source, the knowledge I found was spread out through many forums and no clear source could be found. In any case, I’m certainly not the one who thought about this.

iOS is a stripped down version of OS X, which supports swapping, obviously. However, the flash in your iPhone is not made to handle thousands of writes and this is why Apple doesn’t do swapping on it. Be warned, this will probably end up killing it. How fast? Hard to say. Considering my 3g is 2 years old and I’m eligible for an upgrade soon, I just don’t really care. Please inspect the file before you upload it and understand what it means – I’m not responsible for you nuking your phone. Back it up in iTunes first, too, just in case you have to restore using DFU Mode.

  1. Jailbreak your iPhone ( I recommend pwnagetools )
  2. Install OpenSSH From cydia
  3. Connect to your iPhone using an SCP client (Cyberduck, WinSCP, Filezilla..)
  4. Download this file and rename it from .txt to .plist com.apple.dynamic_pager
  5. Upload this file to /System/Library/LaunchDaemons
  6. Reboot

You will now notice that even after opening a few apps, available memory reported by SBSettings will remain close to 30-35Mb.

On top of that, if you browse to /var/vm , you will see that it created a swap file.

No Comments | Tags: , , , ,

Google’s DNS Versus my ISP’s

In an attempt to see if it was worth it to switch to Google’s DNS, I made a quick performance comparison.

Using DNS Performance Test (DPT) , a tool that uses a random list of domain names, I tested performance over 500 (502 to be precise) queries. First, to my ISP’s servers, then to 8.8.8.8 (Google’s).

This test is far from scientific as I ran both test back to back, didn’t try multiple periods in the day, etc. But whatever, it’s fun !

ISP / Google

Worst Query time: 1166ms /  880ms

Average query time: 167ms / 145ms

Timeouts: 8 / 4

So it would seem that for now Google is slightly faster. However, this is probably nowhere near enough to convince me to give Google some even more logs to profile me, no matter what the privacy policy says..


No Comments | Tags: , , , , ,

Performance impact of clearing your swap file at shutdown

For security reasons, it might be advisable to clear your swap file at shutdown.

It doesn’t provide great security, and you really should be using full drive encryption anways.

But in case anyone is wondering, for a 1.5gig swap file, this option (ClearPageFileAtShutdown) seems to add about 30 to 40 seconds of time to the shutdown procedure as it overwrites the file with zeroes.

Now turn it back off and install Truecrypt!

No Comments | Tags: , , ,