Small by Design: Explaining Snow Leopard's App Sizes

Note: I do not have a copy of Snow Leopard itself, nor do I work for Apple, so these claims are not substantiated from anything that might be covered by an NDA from Apple.

The Set-up

Almost every OS X application has at least one .nib bundle. Developers may be familiar with these bundles, but those who aren't may not be aware that each window you see rendered on your desktop (generally) has at least one .nib bundle that holds the information on how to display that window. These files are generally created with Interface Builder.

Figure 1. Interface Builder, making a .nib bundle

These .nib bundles usually live in the .lproj directories of the Contents/Resources directory within each bundle, biding their time until you open the application and want to open a window. These .nibs can take up a lot of the space of your larger applications. For example, in the stock version of in my Application's folder (288.9MiB), these .nib bundles take up a whopping 223.1MiB!

Figure 2. Look at all those nibs!

Inside each .nib bundle lives a couple of smaller .nib FILES (classes.nib, info.nib, keyedobjects.nib, and designable.nib are just some of the .nib FILES in each .nib bundle), and lately, designable.nib is one of the largest files. However, surprisingly enough, designable.nib is unnecessary once you've compiled an app! Indeed, taking the designable.nib files in together, I have 199.6MiB of designable.nib files I don't need!

Figure 3. There's the culprit!

Now here's the funny part... If I remove those designable.nib files from my, suddenly, my is only 89.3MiB big! That's a lot closer to that 91.1MB touted in that Applications folder isn't it?

The Low-down

Want more proof that it's just the designable.nib files? Take a look at this:

Application Leopard Size (MiB) Leopard Size w/o .nib (MiB) Snow Leopard Size (MiB)
Address 58.2 44.2 40.7
DVD 50.8 50.8 42.4 91.1 44.8 47.9 110.5 54.9 51.8 288.9 89.3 91.1 65.7 55.8 60.5
Utilities/Airport 42.6 42.6 4.6
Utilities/Disk 30.8 30.8 16.2
Utilities/ 68.2 32.5 5.6
Utilities/ 38.6 21.6 8.4

It is interesting to note that SOME applications still show some significant slimming (DVD and those in the Utilities directory), but even these sizes can be explained away by removing other 'extra' files: namely extra languages. By limiting the translations to JUST English, we get the following sizes:

Application Leopard Size w/o .nib (MiB) English-only Leopard Size w/o .nib (MiB) Snow Leopard Size (MiB)
DVD 50.8 10.6 42.4
Utilities/AirPort 42.6 5.5 4.6
Utilities/Disk 30.8 12.3 16.2
Utilities/ 32.5 5.8 5.6
Utilities/ 21.6 2.8 8.4

It's a little bit less perfect a match, but even so, you can see how these sizes can get small in a hurry, without even recompiling!

Special thanks to Orchard Spy for leaking the contents of the Application directory, and the guys at Rixstep for spilling the beans on designable.nib in the first place.