Search Unity

110 MB iPhone 4 binary runs on iPhone 3?

Discussion in 'iOS and tvOS' started by aerende, Jul 30, 2010.

  1. aerende

    aerende

    Joined:
    Apr 27, 2009
    Posts:
    316
    I have a project that is an iPad game with about 110 MB of textures, etc. There are multiple textures per character for the animation. I used Unity to create an XCode project for an iPhone 4 using this iPad game. I compiled it onto an iPhone 4 and it had all of the high resolution that the iPhone 4 is capable of.

    Then I used this same Xcode project and using XCode compiled it onto an iPhone 3 and the game ran! Shouldn't XCode have generated a binary of about 110 MB and this should swamp the DRAM memory of the iPhone 3? Or is there something else going on?
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    1. there is no swap memory at all
    2. there is no hard limit on how much you can fit it. the free memory of the device decides that. the 3GS has 256MB of RAM, about 100 are eaten by the OS
     
  3. aerende

    aerende

    Joined:
    Apr 27, 2009
    Posts:
    316
    I'm loading the 110 MB XCode project onto an iPhone 3G which only has 128 MB of DRAM, so it doesn't make sense that the project could load on the iPhone 3G. But it does load and it runs. Anyone understand why this would work?
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Because not all data is loaded all the time.

    It will only load the application binary code (14-18mb in case of unity 1.x) + what you tell it to load due to having it in the scene or loading it from Resources / Asset Bundles.

    Thats all thats loaded, the rest is there on the flash disk and iwll be loaded when required and asked to, but only then