Forum rules - please read before posting.

iOS memory usage

I'm currently testing the beta version of my game on iOS, both iPhones and iPads (iPad mini 1st gen and iPad air 2).

I got some reports on crashes and right now I'm doing some memory debugging in the xcode tools and see that the memory usage is steadily rising for each new scene and finally receiving a memory warning:







Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 2482.

Total: 4.660250 ms (FindLiveObjects: 0.188916 ms CreateObjectMapping: 0.081875 ms MarkObjects: 4.376333 ms  DeleteObjects: 0.012166 ms)


2016-09-13 22:52:09.079 milkmaid[5731:4072576] Received memory warning.

WARNING -> applicationDidReceiveMemoryWarning()

-> applicationWillResignActive()

-> applicationDidBecomeActive()

It appears that not enough assets are unloaded. Is this an AC or Unity thing? What can I do to prevent this from happening? My game is fairly large (70-ish scenes), but not very complex and use 2D graphics and sprite sheets. Any help or hints very much appreciated, as I'm not sure how to amend this.

I'm on AC 1.52a/Unity 5.3.5f1 personal/xcode 7.3.1.

Comments

  • Try a backup with the latest AC - there's always fixes and improvements being made that may affect it.

    There's not really enough here to go on so far as learning the source of
    this goes.  Is there a way for it to output more detail, specifically
    which objects are loaded?

    A few random questions:
    1. Are you making use of animated cursors or icons?  In older versions that was a bit of a hog.
    2. Does the count increase if you go back to a previously visited scene?
    3. Does the count increase if you visit a non-AC scene?
    4. Does the count increase steadily, or do larger scenes see a bigger increase?
  • edited September 2016
    Thanks, I've done an update to latest AC and there is not change in memory usage.

    Sorry for the nonspecific questions, but I have no previous experience with Unity-based iOS apps.

    1. I'm not using any animated cursors
    2. Yes, the count increases when I go between the same scenes, but only slightly.
    3. I'm not using any non-AC scenes, maybe I'll have to rig a test scenario and see if it behaves differently.
    4. It does appear that more complex scenes has a bigger increase.

    I will try to build a version without sound and see if that could be the culprit. Sound could be a memory hog, but still I find it strange that the loaded objects increase when I go back and to the same scenes. Will report back, and if anyone has any experience or tips with AC/iOS, please chime in! :)

    EDIT: I've changed all background music to Streaming Vorbis at 70%, and that have seemed to lowered the memory footprint on iOS by quite a bit. Will test some more, but as I suspected sound might have something to do with this.
  • There are some good resources via Google on optimising audio for iOS.

    Do you have many "Remember" scripts attached to your objects?  That the count increases much less when revisiting scenes suggests that it could be down to the internal storage of room data.  As the whole ethos behind the save system is that only the the necessary data is saved, that generally shouldn't be an issue - but if you have many such scripts that could contribute.
  • I have some Remember scripts attached, but I believe the root of this was mainly non-optimized audio. I was able to play through the whole game yesterday on my old iPad, and even if memory surged at a couple of more advanced scenes, the game never crashed or misbehaved. Memory use went down again on the simpler scenes, so it indicates that Unity/AC is working properly.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.