Size of executable in app bundle too big? RRS feed

  • Question

  • User223 posted


    just a feeling but: I have an iPhone app that is a tab bar app and uses a bit of Sqlite.Net. The size of the executable in the release app bundle is 5MB. I don't know, but this seems rather big. Is there a way to tell if the size is normal or if something unexpected has been included?



    Wednesday, February 13, 2013 5:54 PM

All replies

  • User34 posted

    It's hard to say without more data about the application itself, e.g. the list of assemblies and native libraries (if any) and their sizes (before stripping).

    In general you should:

    • Make sure you're building for Release (not Debug) and that includes verifying that your release settings do not have debug settings enabled;

    • Make sure you're building for a single architecture. If you're building a FAT application (e.g. ARMv7 and ARMv7s) then it will nearly double your main application size;

    • Make sure linking is enabled (it's likely set for Link SDK otherwise it would be a lot larger than 5MB);

    • If you have a lot of user code (anything that does not ship with MonoTouch) look at using Link All.

    Also note that linking the mono runtime has a non trivial initial cost (in size) but doubling your application code won't double it's size. As such a basic "hello world" application will be large (compared to ObjC) while most medium-sized applications are not much bigger than ObjC applications.

    Wednesday, February 13, 2013 6:47 PM
  • User223 posted

    Thanks @poupou, here are my settings:

    • RELEASE, no debug code
    • ARM v7
    • No third party libs
    • Link SDKs only

    I created an empty single view project and built that for comparison: the executable in the app bundle is already 3.8MB. So it looks like this is just the basic size of a MonoTouch application? Is that a reasonable size?

    Wednesday, February 13, 2013 7:27 PM
  • User181 posted

    5MB isn't a big deal. It could be smaller, sure, and MonoTouch does add some significant overhead, but 5MB is nothing to worry about. No one is going to have trouble downloading it or complain that it's too big. The only size limitation I'm aware of for apps is if an app is bigger than 50MB then you can only download it over WiFi (no cellular). Apps can be gigabytes in size, though.

    For comparison, Keynote for iPad is around 100MB, and Data Dashboard (our application for iPad) is about 40MB.

    tl;dr Don't worry about it.

    Wednesday, February 13, 2013 7:41 PM
  • User34 posted

    Yes, that sounds about right, I had 3.5 MB in mind - but it's been a while since I measured a hello world app.

    It used to be quite larger (closer to 5MB) but a lot of work was done to keep reduce it (even if we added many features and performance optimizations that added quite a bit more code, e.g. specialized trampolines).

    As for being reasonable that's a personal opinion ;-), e.g. considering the size of a full screen retina image for an iPad (12.5MB uncompressed).

    Seriously even if normal, for today, we continuously keep looking into ways to reduce it. It's also worth nothing that many size optimizations are not visible in "hello world" type of applications.

    Wednesday, February 13, 2013 7:52 PM
  • User2589 posted

    @Krumelur after some investigations I found out one optimization was not applied (anymore) and it's one that helps small (network-less) applications.

    Honestly it won't really affect most applications (that use networking/HTTP) but it shows a lot on small ones (like hello world and building empty templates).

    Disclaimer aside the minimal executable size I got (release), once re-enabled, is 2.5MB while the whole .app directory is 3.1MB.

    Tuesday, February 19, 2013 3:27 PM
  • User223 posted

    @poupou Oh, cool! That will indeed affect my latest utility app. What MT version will the optimization be applied to?

    Tuesday, February 19, 2013 8:24 PM
  • User2589 posted

    @Krumelur It's not in the just released 6.2 (it was already frozen) but it will be in the next maintenance release.

    Wednesday, February 20, 2013 2:59 PM
  • User1191 posted

    A key question would be how big is a Hello World or empty app with Xcode/Obj-C? the diff would be the overhead (if any) by the Monotouch tooling.

    Monday, August 26, 2013 5:51 PM