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

4.6 IL2CPP Memory Crashes

Discussion in 'iOS and tvOS' started by eezSZI, Apr 20, 2015.

  1. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    @TinyMobGraham

    Yes, all of the memory improvements are in 5.1.1p2 now. We have some more improvements we are working on now, and anything new will go to 4.6 and 5.1 patch releases.

    As mentioned in the announcement about 5.0.3p3, it is the last patch release we are planning for the 5.0 series. We'll have a 5.0.4 to roll up the 5.0.3p1, p2, and p3 releases. But if you are are looking for more IL2CPP fixes in the future, you will want to start moving to 5.1.
     
    TinyMobGraham likes this.
  2. kobojo

    kobojo

    Joined:
    Jan 13, 2015
    Posts:
    1
    @JoshPeterson did you guys have any luck reproducing our issue yet?
     
  3. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    @kobojo

    No, sorry, we have not investigated this issue yet. I'll try to have a look at it today though. Thanks for pinging me.
     
  4. DMinsky

    DMinsky

    Joined:
    May 20, 2012
    Posts:
    30
    Any updates on this issue?)
     
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    @DMinsky

    Looking back over the thread, I'm unable to see which specific bug report number was discussed here. Generally, we've shipped a number of changes in the last few releases to make initialization in IL2CPP more lazy at runtime, meaning that often the memory usage of a project will decrease, as we longer allocate memory for things that are not really used at runtime.

    Let me know if you are still seeing issue with the latest patch release, and we can investigate.
     
  6. PixoChu

    PixoChu

    Joined:
    Oct 16, 2013
    Posts:
    5
    @JoshPeterson

    I'm a bit late to this party..but we're seeing some issues similar to the topic that's being discuss throughout this thread. What version/patch should contain the memory improvements. Thanks.
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    @PixoChu

    I would recommend the trying the latest path release. I don't recall the exact version where the most recent memory improvements shipped, but the latest version will be the best option, I think.
     
  8. PixoChu

    PixoChu

    Joined:
    Oct 16, 2013
    Posts:
    5
    @JoshPeterson

    Thanks for the quick reply. I tried 5.2.2p3 and we're still experiencing the same issue. I'll keep poking around. It may be important to note that building to mono, we don't experience the same memory crash issue that we do when building to IL2CPP.
     
  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    @PixoChu

    Thanks, that is important information. It might be worthwhile to submit a bug report, if possible, so that we can have a look at the specific issue. These are sometimes difficult to track down.
     
  10. PixoChu

    PixoChu

    Joined:
    Oct 16, 2013
    Posts:
    5
    @JoshPeterson

    We eventually found our problem and narrowed it down to 1 method we were using to create thumbnails. As far as we can tell it had something to do with Threads or Mutex, but when I rewrote the method without those 2 types (tho less efficient) we no longer experienced the leak. Not sure if that helps you guys, but it saved our arses.

    Good luck.
     
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    @PixoChu

    Thanks for letting me know. We'll keep this in mind for future, similar bugs.
     
  12. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Sorry for this dumb question:
    Is there really no way to check in runtime, if the app is getting close to a termination due to memory limits?
    What we need is simplified: Memory available - memory used.

    Right now it´s kind of unprofessional.
     
  13. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    @Cascho01

    Memory restrictions can vary pretty widely for different platforms. Usually this is best handled with platform specific code then. I'm not an expert on iOS, but I've found this information, which might be helpful. Maybe others with more knowledge of iOS can help.
     
  14. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Yes, this seems to be the information needed, so is there anyone who can explain how to get this in Unity c#?