Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity 5.0/5.1 Additional Memory Pressure

Discussion in 'iOS and tvOS' started by jasonmcguirk, Apr 27, 2015.

  1. jasonmcguirk

    jasonmcguirk

    Joined:
    Apr 20, 2013
    Posts:
    10
    Hey Folks,

    Just wanted to share some numbers with the new IL2CPP and see if they square up with folks are seeing.

    The increased IPA sizes are well documented and are something the Unity team is actively working on (which is rad)

    Here's what we're currently seeing
    • Unity 5.1b4 IL2CPP IPA Universal - 77.50 MB
    • Unity 5.1b3 IL2CPP IPA Universal - 77.41MB
    • Unity 5.1b3 IL2CPP IPA 64bit only - 51.2MB
    • Unity 5 IL2CPP IPA Universal - 78.06MB
    • Unity 5 Mono IPA 32bit - 51.16MB
    • Unity 4.6 Mono IPA 32bit- 63.35MB

    Additionally, and more concerning for us - is the additional memory pressure we're seeing.

    To get to load complete in our game on an ipad mini 2 on iOS7 - here's what we're seeing

    • 4.6 Mono IPA memory @ load complete - 188 mb
    • 5.0 IL2CPP memory @ load complete - 212 mb
    • 5.1b4 IL2CPP memory @ load complete - 212 mb

    This is measured from the following snippet which grabs the size of the process via the task_info api

    struct task_basic_info info;
    mach_msg_type_number_t size = sizeof(task_basic_info);
    kern_return_t kerr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&info, &size);
    return (kerr == KERN_SUCCESS) ? (int)info.resident_size : 0; // size in bytes
    My somewhat uneducated guess here is the additional assembly size from supporting both 32/64b is showing up in additional stack size.

    This is particularly concerning since it leaves us extremely little head room before we get zapped - iOS7 + Mini 2 is already a particularly bad platform for us from a stability standpoint and an extra 20mb is pretty backbreaking.

    Does this square up with others findings? Are there code patterns which cause more or less pressure?

    Cheers!

    McG
     
    MrEsquire likes this.
  2. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Do you really have memory issues with iPad Mini 2? It's a 1GB device, so it should be handling quite well even 512 MB or more. It's expected that Unity apps running in 64 bit mode will take some more memory if compared to 32 bit mode.
     
  3. jasonmcguirk

    jasonmcguirk

    Joined:
    Apr 20, 2013
    Posts:
    10
    Hey Mantas,

    Nope - sorry, got confused with model numbers.

    Our specific challenges are with iOS prev-prev-gen devices - IPad 2, Mini 1 and IPhone 4/4S
     
  4. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    So these numbers you posted are actually from iPad Mini 1st gen?