Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
09-19-2011, 08:30 AM #1Speed up iPhone without crippling it (launchdaemon editing)
First post here. I have been trying to free up memory and cpu cycles on my old 3G for months now, following different guides I found on the internet, and I have concluded, that most tweaks hardly do anything without taking away some functionality that I actually want - like spotlight search. Then it dawned on me, that launchd doesn't just start processes and keep them running. It also provides the possibility of starting and stopping processes on demand. By tweaking KeepAlive and ExitTimeOut settings in different launchdaemon plists I have got a device that for the most part is faster, have more ram available, and doesn't loose any functionality whatsoever. The daemons that responds best to this kind of tweaking seems to be:
These daemons now start when needed and quits again after being idle for a few seconds. when I'm not seaching with spotlight, using location services, syncing or installing my 3G is only running 17 processes, and has approximately 50 Mb free memory. Oh - and it drastically improved my batterylife - probably mostly due to locationd not running when not in use.
Last edited by djustiz; 09-19-2011 at 08:33 AM.
09-19-2011, 09:45 AM #2
09-19-2011, 10:11 AM #3
but removing launchdaemons removes the functionality. Editing them to make them run only when they are needed are two very different things to me.
09-19-2011, 10:34 AM #4
The link was for 'Information Purposes' only.
09-19-2011, 01:09 PM #5
09-19-2011, 03:55 PM #6
The Mod works like this; launchd does NOT work like a DOS/windows batch file that simply loads everything and keeps it in memory - it has very sophisticated process control functions - like a combination of init.d and watchdog on*NIX. In short - it is able to monitor when certain daemons are needed, and when they are not. Thus searchd can be configured to start up once you enter the spotlight page, and exit again after being idle for a set time.
For the listed daemons I set the KeepAlive option to 'false' (boolean), and I've set ExitTimeOut to 3 (integer). Currently restoring after getting a little too creative with the springboard.app - but when I'm done I could post the edited daemons, or write a guide. I recommend reading the man-page for launcd. :-)
Last edited by djustiz; 09-19-2011 at 04:00 PM.
09-20-2011, 12:16 AM #7
Here's an example of an edited com.apple.accessoryd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
The ExitTimeOut value defines the idle time in seconds before launchd terminates the process. (the default is 30 seconds)
KeepAlive defines whether the process needs to be running continuously, or if launchd is allowed to shut it down when its idle. KeepAlive has a lot of different parameters to define under what circumstances the process should be running, but if you want it to shut down as much as possible, the key needs to be a simple boolean false.
The RunAtLoad key specifies if the daemon is to start running immediately (during boot), or if launchd should wait and launch it on demand. The default launchd value is false, I only set it in accesoryd because it was set to true by apple.
Most of the daemons (even most of the ones on the "Speed Up Your iPhone/iPod by Removing Launch Daemons"-list/thread) is already configured by apple to be launched when needed, and killed off when idle - and removing them will not free up additional ram on your device - perhaps during the first few minutes after startup since many of them has the RunAtLoad flag set to true - but after launchd has killed them off after the default ExitTimeOut period they will not take up any precious ram unless you use those specific features. Deleting them may however speed up the booting process. The daemons I chose to manipulate was the ones that was continuously running on my system - even after several minutes of idling. Only I do not know if this is also true for the "safe" daemons (crashreporting etc.) - since I deleted those from my system, and have not yet tried to reenable them to see what is actually running.
Here's a zip of the aforementioned plists. I'd recommend backing up your original files before you start to edit/swap any plist-files.
08-07-2012, 06:43 PM #8