Search Unity

iOS Large Memory Usage = Apparently Feature, Not a Bug?

Discussion in 'iOS and tvOS' started by Xander-Davis, Mar 2, 2019.

  1. Zimbres

    Zimbres

    Joined:
    Nov 17, 2014
    Posts:
    180
    I sincerely cant believe on this. The memory cap is lower, and the texture uses up to 3x more space than normal? And by July 2019, is it still an issue? Like, really?
    Really?

    I'm testing a game on an IPad6, and I have a crash when the game reaches almost 1gb of video memory use. This is odd, because it does not matters if we change the texture quality on QualitySettings to Eighth Res. The crash happens anyway.
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    It's not odd, the full res texture is still in memory, it just loads a higher level mip to show, which may have performance improvements.
     
    Zimbres likes this.
  3. Zimbres

    Zimbres

    Joined:
    Nov 17, 2014
    Posts:
    180
    Thanks AcidArrow! This explains a lot. Do you know, by the way, if there's any way of building an app with lower texture sizes?

    (edit)
    I will try that texture platform override thing
     
    Last edited: Jul 16, 2019
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    I generally do it manually, I go to each texture and change the desired size.

    I'm guessing it should be doable automatically with an editor script that sets the max resolution of the TextureImporter
     
  5. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513
    Nope. My 2D game is running terribly on iPad Air to the point of being unplayable.
     
  6. KristoferBoman

    KristoferBoman

    Joined:
    Feb 16, 2016
    Posts:
    61
    Apple removed the memory entitlement in iOS 13. We had to stop supporting 1 GB iOS devices. Right now we show a popup for these users telling them their device is not supported. Eventually we will build the game with iOS 13 as the lowest supported OS version.
     
    Xander-Davis likes this.
  7. ttermeer-reboundcg

    ttermeer-reboundcg

    Joined:
    Jul 12, 2017
    Posts:
    62
    Considering that most developers are forced to switch to iOS 13 to include Apple Sign In before 20 April 2020, it won't be a direct problem. We will have to blame Apple that enforce obsolescence on us.
     
  8. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    I’m not sure but isn’t that just we need to use iOS 13 sdk? I think that’s available using Xcode 11 and I think we can still release games on earlier versions of iOS. I agree with you though that obsolesence is thrust upon us and I think it’s the hardest part of game design for me to keep up with it.
     
  9. ttermeer-reboundcg

    ttermeer-reboundcg

    Joined:
    Jul 12, 2017
    Posts:
    62
    Well the Apple Sign In only works on device with iOS 13
    I haven't tested it myself yet. I have no idea if you are able to target iOS 11/12 and have that functionality still work in iOS13 devices.
     
    protopop likes this.
  10. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    I think you’re right that if you want to support Apple sign in then you’d have to target iOS 13 on your build. If you don’t support it I am guessing you could still build for iOS 10 and up (unity’s 2020 minimum iOS version ) as long as you build with the iOS 13 sdk in newer versions of unity.

    Honestly I so barely grasp all this I’m amazed I’ve been able to upload anything :)
     
  11. chaseholton

    chaseholton

    Joined:
    Dec 17, 2012
    Posts:
    78
    I'm glad I'm not alone in this memory mess. I know this is a relatively old thread now, but I've been working hard to optimize my game and I didn't realize it was still using around 1.2 gb of Ram. Basically relegating it to iPhone 8 Plus and above age devices. Not a super wide pool of devices to use.

    I'm going to continue and try to figure out Addressables (lol, wish there was more documentation because every tutorial is solid for a portion of it, but then it's not as useful by the end). But man, I haven't had this much trouble reducing memory in a while.
     
  12. AbraTabia

    AbraTabia

    Joined:
    Jul 21, 2019
    Posts:
    11
    Hey guys, I just built my first game from scratch, my first 2 games were to practice so I used a chess and puzzle match template for them, they run fine on mobile because they are small and optimized by someone else who knew what they were doing on this topic. My game came out the way I wanted, look and functionality wise, I am sure I need to optimize a lot of things with graphics and am still learning that. But runs perfectly on windows and mac, so I just built it on my iphone just to see if it would even run, crashed hard. Its a board game so I have an animated scene as the home screen, took up like 600MB of memory and ran fine, but the game is literally all loaded in to one main scene (which I think is ok if I optimized it better), so once I click to the game scene my memory shoots up to 1.77 GB when my iphone crashes (crashed at 1.6GB when I had other stuff open in the background). I think it doesn't need much more than that, possibly 2GB would make it run in its current state.

    I don't really plan on making this an iphone app, screen is too small to be really playable, so ipad is the real goal, but I use an iphone X to test with since I don't own a newer ipad (my ipad is like 7 years old so useless, it can't even upgrade higher than IOS 9 i believe). So can any of you just shed some light on how massive that is? Like I do know it's too big and am working on it, but what's the target amount of max memory that I should be going for? restricting to IOS 13 should be a decent option for me for this game, my plan is to have it on windows by like june so ipad can wait a little longer and its a new app so no existing users/devices to worry about.

    Most threads I am reading about this max memory limit is related to video, which makes sense, and they seem to be able to use over 1GB and from what I am reading here, 2GB seems to be possible on IOS 13? Or do I have a bigger problem and need to do some serious removal/optimization of graphics to ever get this game running on IOS?
     
  13. chaseholton

    chaseholton

    Joined:
    Dec 17, 2012
    Posts:
    78
    As far as I can tell in mobile development, specifically on iOS, the memory limit before crashing is roughly 1/2 of the total RAM on the device. So a 2GB iPhone / iPad will crash at around 1GB. I've been busting my a** trying to keep memory usage low but with a game of the scale I'm making (admittedly not huge, but probably a bit ambitious for mobile...) Ram is a constant struggle. Like the OP said, I don't recall seeing this in my previous projects. I honestly didn't consider memory limitations back then so now that I see it and it's apparently 3x what it used to be... Man, I can't imagine what we could pull off if memory usage was reported correctly. I mean, Apple says now that's what they are doing, but if they didn't crash before, it wasn't a reporting issue, it was just less memory being used. Period.
     
    AlejMC likes this.
  14. AlejMC

    AlejMC

    Joined:
    Oct 15, 2013
    Posts:
    149
    Could we say that a good rule of thumb to try is to get the SystemInfo.SystemMemory and assume that 'half' of it (minus a safety padding) is reserved for the app currently running?
     
  15. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Did anyone ever get this sorted?
     
  16. ttermeer-reboundcg

    ttermeer-reboundcg

    Joined:
    Jul 12, 2017
    Posts:
    62
    Devices that were affected are no longer supported so this issue is "gone"
     
    derkoi likes this.
  17. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    True. If i update my game with the latest iOS 14 or whatever will my old players still be able to play their game & all those with supported devices will be able to upgrade?
     
  18. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    There are still definitely memory issues on iOS. Been trying to pinpoint it off and on for a while, but just noticed something fishy again today.
     
    TruAmbition likes this.