Why is our app twice as large as what we submitted? “Contagious zeros”

iTunes App Store

As you probably know, Apple has an app download limit for users downloading over 3G. Up until recently, this limit was 10 MB. If your app’s file size exceeds the limit, users attempting to download it over 3G receive an error and must try again later over wifi. Needless to say, this can lead to frustrated users and lost sales and if you can get your app under this limit, it’s definitely worth the effort.

So, when we submitted our latest update of Pig Rush to Apple for review, we worked hard to get it under the (then) 10 MB 3G app download limit.

Eventually, we got the file size down to 8.9 MB, knocking a massive 66% off of the original file size. Awesome!

We then submitted our update to Apple for review. Amazingly, only 12.5 hours later it was approved and live on the App Store. Excellent!

Then we noticed the file size listed in the App Storeā€¦ 16.5 MB.

How could this be? This was nearly double the size of what what we submitted!

We downloaded the compressed package from the app store, and compared it to the version we uploaded. Sure enough, the version on the App Store was larger: 17.4 MB vs. our 8.9 MB version.

We extracted both files to compare, but apart from some standard config files added everything was the same.

Upon further inspection, it turned out there was one big difference: the main executable was 13.7 MB in both versions. However, the App Store version of this file compressed to 12.4 MB while ours compressed to 4 MB.

That’s a pretty significant difference. We decided to ask Apple about this, and here’s the answer we got:

“When your application is delivered to Apple, it is encrypted for DRM purposes and re-compressed. When the encryption is added, the size of the compressed file will increase. The exact size of the increase will vary from app to app, however, the size increase can be large when the binary has a lot of contagious zeros in it. We are unable to guarantee the size of your file after the encryption has been added.”

File size increasing after encryption is added makes sense – but an increase from 4 MB to 13.7 MB seems extremely high. I’ve also never heard of “contagious zeros” before, and it looks like I’m not the only one.

Luckily, the new 3G limit has been upped to 20 MB so we still fall under it, but I’d still be interested in hearing others’ experiences in final app package size vs. what was uploaded. Also, if you have any suggestions on limiting the number of contagious zeros in your binaries, please let us know.

Stephen Ceresia

Stephen Ceresia is Marketing Manager at ReignDesign. Stephen is from Canada and is currently based in Shanghai.


  1. this is likely because ciphertexts are relatively incompressible

    in keeping with this, “contagious zeroes” is probably a typo; what the person probably meant is “contiguous zeroes”, which would compress well, but such blocks of easily compressible data would obviously disappear in the ciphertext

  2. Apple are doing this the wrong way round. They encrypt, then compress. The encrypted file will never compress well. If they were to compress, then encrypt, everything would be fine.

  3. @Steve
    Yes, that would compress well, but it would defeat the point of the encryption. Apple is doing this correctly (unless you consider the option of not encrypting the executable).

  4. I can help you here in Chile to talk about this “contagious zeros”. Send me (via Fluxa) the spanish version of this story and I will contact Fayer Wayer (one of the top geeky websites in LatAmerica) and maybe La Tercera (Big Newspaper).
    Best regards,
    Jose Francisco Hurtado
    Journalist and part time Hero

  5. Curious how to reduce the contiguous zeros… we have run into this same situation, but not clear from Apple how to fix. Any advice?


Leave a Reply

Your email address will not be published. Required fields are marked *

Share this post