edited December 2019 in ORK Support
Hi GiL,

we have successfully implemented Asset Bundles into our mobile game, Makinom is downloading the bundles from our server and ORK is using them in the game. Android platform works fine, the memory load is about 450MB (tested on the phone as well), and the bundles are loading and unloading during gameplay. Bundles are about 160MB, so it goes up and down as it should.

The issue we currently have is with the iOS platform (which is our main Platform with the most customers). The game starts fine, the Asset Bundles are downloaded and they work. The problem we have is with memory usage. In editor, profiler is showing 0.8GB memory load and everything seems to be working fine, loading and unloading.
But when testing directly on the phone thru xCode (or appstore), the memory load is about 1.25GB while in menus, during combat and (using a lot Assets), it bumps for 1,4GB or even higher and returning to the menus has no effect, ORK is not unloading the Asset Bundles, so the memory stays at 1,4GB until it eventually hit's the 1,45GB Memory limit of the most iOS devices and crashes the game.

We are using the latest ORK version 2.27.1 running Unity 2017.4.27f1. Game settings are checked on Unload Asset Bundles and path is Persistent Data Path.

Do you have any experience why this might be happening, or anybody else reported something similar? We have tested different configurations, multiple builds, different devices, 2 different ORK versions. I am at the end of my knowledge.

Thank you a lot in advance,
SaVe
Post edited by save1418 on
  • edited December 2019
    Would like to add, that bundles are created by Unity made Asset Bundle Browser and the iOS bundles have 180mb. The Profiler in Editor is very precise for total memory used 0.45gb on Adnroid. For iOS it shows 0.8gb as a base and always returns to this value in our main scene. Even with all the bundles being loaded, it should start somewhere around 1gb.

    But directly on Iphone 8, every scene load increases the memory requirement, we assume the bundles are creating some memory leak which was many times reported among Unity issues, however there is nothing for that version we have.
    Post edited by Machal on
  • I think this is mainly up to Unity and how you're using the asset bundles.

    E.g. if you have 1 bundle with everything in it and it's compressed, Unity needs to uncompress the whole bundle just to read the content information.
    I'm also not sure if Unity unloads a bundle if something in it is still used.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Its about 60 bundles that made 180mb. They are being loaded only by ORK set up in Asset Settings. Same goes for unloading, using option 'Unload Asset Bundles'. So whatever happens then is out of our control.
  • Using Unload Asset Bundles will do this for bundles loaded by ORK when changing scenes (using the asset bundle's unload function). The rest is up to Unity.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • We are having issues, trying to figure it out for several days/weeks now. I have found this article, it looks as the same issue we are having.

    Can you please have a look and give us your opinion? Thank you very much in advance.

    https://forum.unity.com/threads/www-memory-leak-ios.227753/
  • WWW was actually deprectated, you should use UnityWebRequests instead.
    I think they're already available in Unity 2017.4.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • We're using Unity 2017.4.27f. We're using only ORK for bundles, so I assume that it uses UnityWebRequests then and that article is obsolete?
  • ORK uses neither WWW nor UnityWebRequests, as ORK only loads bundles that are already available and doesn't handle any downloading of bundles.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited January 2020
    I see, it's not related then. But the issue is similar. The bundles get downloaded properly, even loaded by ORK Asset Settings and events. It's just that it isn't unloaded. The project starts already with all Asset bundles loaded in the memory that never get's down.

    Funny that it works in Editor, but not on the iOS device.

    Is ORK Asset Settings somehow incompatible with iOS Xcode?
    Post edited by Machal on
  • ORK's asset settigns aren't anything fancy and call standard Unity functionality, I don't see a reason why it wouldn't work on iOS, except that there's something in Unity working against that.

    If you're downloading the asset bundles, I'd try including them (e.g. in a StreamingAssets folder in your project) instead and see if it works that way. If it works, the download might somehow keep them in memory ...
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.