Search Unity

What is 'Objects' shown in Memory Profiler for iOS represented for?

Discussion in 'Editor & General Support' started by Sparrowfc, Dec 28, 2016.

  1. Sparrowfc

    Sparrowfc

    Joined:
    Jan 31, 2013
    Posts:
    100
    When I using Profiler to profile my ios APP, I notice a large memory is used by 'Other/Objects' when looking the Detailed memory usage.

    After several test, I found the behaviour of that part of memory is very similiar to ManagedHeap which is shown in Editor Profiler or Android Profiler but not in iOS Profiler.

    Now I'm assuming the 'Object' is playing the role of ManagedHeap since I'm using il2cpp.
    Can anyone confirm me with that? And does the 'Object' behave exactly like the ManagedHeap which for more specific only goes up and can never be released.
     
  2. Zenix

    Zenix

    Joined:
    Nov 9, 2009
    Posts:
    213
    Bump... I would also like confirmation of what 'Objects' is...
     
  3. ckirby101

    ckirby101

    Joined:
    Aug 21, 2014
    Posts:
    10
    Bump! Can Unity please tell us what this is..
     
  4. Prometheusheir

    Prometheusheir

    Joined:
    Aug 15, 2015
    Posts:
    20
    Bump. No clue what this is but it is growing 100MB per hour if my game is just sitting idle. Need to know what I am dealing with here.
     
    LOK likes this.
  5. wcw

    wcw

    Joined:
    May 27, 2013
    Posts:
    4
    Bump. Anyone knows?
     
    LOK likes this.
  6. sunxdc15

    sunxdc15

    Joined:
    Jan 2, 2014
    Posts:
    8
    Bump, where's Unity guy?
     
    LOK likes this.
  7. johannesahvenniemi

    johannesahvenniemi

    Joined:
    Feb 17, 2015
    Posts:
    2
    Bumb!
     
    LOK likes this.
  8. Sam-DreamsMaker

    Sam-DreamsMaker

    Joined:
    May 2, 2015
    Posts:
    13
    Bump,
    I have nothing in a scene and Other>Objects take 1GB
     
    Jeremy-Lv likes this.
  9. KristoferBoman

    KristoferBoman

    Joined:
    Feb 16, 2016
    Posts:
    61
  10. dmarfurt

    dmarfurt

    Joined:
    Apr 28, 2013
    Posts:
    9
    I also would like an answer to this.
     
  11. mattpistella

    mattpistella

    Joined:
    May 16, 2018
    Posts:
    1
    Bump it up!
     
  12. armaan8014

    armaan8014

    Joined:
    Jun 13, 2017
    Posts:
    25
    Almost 2 years since this thread started. Bump!
     
  13. julian_cruz

    julian_cruz

    Unity Technologies

    Joined:
    Nov 21, 2016
    Posts:
    16
    There was a bug in unity 2018.1 and prior, where Other - Objects, is collecting its amount from several objects that unity contains already in categories such as assets, scenes, asset bundles, gfx memory is also included, so that's can be ignored, given that those are duplicate data. I'd recommend testing in 2018.2 and later.
     
  14. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    Is the fix being back-ported to 2017.4 LTS?
     
  15. julian_cruz

    julian_cruz

    Unity Technologies

    Joined:
    Nov 21, 2016
    Posts:
    16
    I've requested this backport, but I will let you know when this can be seen in our issue tracker. Once the backport will be approved.
     
    Peter77 likes this.
  16. blueteak

    blueteak

    Joined:
    Feb 19, 2013
    Posts:
    140
    I see "Objects" as 0.58GB in memory profiler in Unity 2019.1.0f2
     
  17. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,461
    Hi all, apparently there was never filed a bug report for the issue where objects where reported double, once under a proper root and once under Other -> Objects, so lets treat this thread as one. The issue was resolved in 2018.2.0a6 and the fix was back-ported to 2017.4.19f1

    That means any versions after that have that fix included (i.e. 2018.3.x, 2018.4.x, 2019.1.x, 2019.2.x, 2019.3.x, ...). If there are any issues that appear similar to this, please do file a bug with a repro project through the bug reporter. The data shown by the (memory) profiler should be reliable (and actionable) and we'd want to fix whatever we can where that is not the case.

    @blueteak That version should have the fix mentioned in this thread so whatever you're seeing is likely a new issue. Please file a bug report so we can investigate and fix this.
     
  18. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,461
    Also, for any future cases: no allocations should be shown under Others - Objects.
    If there are, that's a bug. Please report it.
     
  19. CerebralFrost

    CerebralFrost

    Joined:
    Mar 28, 2017
    Posts:
    12
    2017.4.33f1:

    upload_2019-10-18_18-18-8.png

    This was captured during async scene loading. The scenes are stored in asset bundles. Once the load is complete the Other->Objects goes away, however during the load the memory spike has caused the game to get evicted for OOM (Android).

    This is what we see after the load is complete:
    upload_2019-10-18_18-21-22.png

    Is this a reportable bug, or as expected?
     
  20. alexrvn

    alexrvn

    Unity Technologies

    Joined:
    May 16, 2017
    Posts:
    53
    Hi! Please file a bug, objects should not show under other.
     
  21. matheus_inmotionvr

    matheus_inmotionvr

    Joined:
    Oct 3, 2018
    Posts:
    63
    Any news about this issue? I see "Other>Objects" consuming almost 300Mb when loading a level asynchronously. After the level is completely loaded, it's gone. Running Unity 2019.2.15.
     
  22. SkymapJosh

    SkymapJosh

    Joined:
    Nov 21, 2019
    Posts:
    16
    We are also seeing an increase in 300 MB whenever we load async, but that 300 MB isn't being cleared and just consistently adds to Other->Objects each time. Eventually this leak crashes our game.
     
    matheus_inmotionvr likes this.
  23. SkymapJosh

    SkymapJosh

    Joined:
    Nov 21, 2019
    Posts:
    16
    For us this appears to be from fragmented memory.
     
  24. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    It seems I'm running in the issue too. Testing our game for about 30 minutes on an Android Samsung Galaxy S6, using Unity 2019.4.20f1, causes "Other Objects" to go up significantly.

    Do you know if this is a display bug or if the memory is actually consumed?

    upload_2021-5-27_16-7-20.png

    BTW
    Profiler.GetTotalReservedMemoryLong() + Profiler.GetMonoHeapSizeLong()
    shows 290 MB only, where the Profiler shows over 1.4 GB. What's correct?
     
  25. alexrvn

    alexrvn

    Unity Technologies

    Joined:
    May 16, 2017
    Posts:
    53
    Heya!


    Profiler.GetTotalReservedMemoryLong() = all memory reserved by Unity's Memory Manager (loops through all allocators)
    Profiler.GetMonoHeapSizeLong() = mono/il2cpp vm internal counter that keeps track of all memory reserved by the scripting backend
    I'd trust these two over all others.

    Objects = Object root(all memory related to roots is accounted for in the memory manager thus included in GetTotalReservedMemoryLong), referes to any UnityEngine.Object inheriting type (eg anything that is a managed representation of a native type: textures, gos, components, Monobehaviours, Assets in general). This is more of a counter that says x amount of memory goes into this category

    Could you please file a bug with this guy...this looks pretty weird.

    Cheers,
    Alex.
     
    Last edited: May 27, 2021
    Peter77 likes this.
  26. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    Thank you for the quick reply. I let the game running to see if it crashes when it reaches its physical memory, but it still runs.

    upload_2021-5-27_18-43-43.png

    The Samsung Galaxy S6 I use for testing has 3 GB RAM. If check on the phone "Settings > Device Maintainance > Memory" I see the game does not consume 5+ GB, but consumes pretty much what is returned by
    Profiler.GetTotalReservedMemoryLong() + Profiler.GetMonoHeapSizeLong()
    .

    The ever increasing "Objects" issue doesn't cause a crash and maybe it's a "display bug" in the editor only?!

    However, there is still a memory leak going on. I find thousands of sharedassets2.assets entries in the profiler:

    upload_2021-5-27_18-48-9.png

    But that's most likely not your issue anyway. I have to investigate where this comes from, I hope to find some useful information of that sharedassets2.assets thingy.

    I have to get permission from the company who owns the rights to the project, it's not my own. If they allow me to send it over to Unity Technologies, I'll send you the Case number.
     
  27. piegaro

    piegaro

    Joined:
    May 17, 2017
    Posts:
    10
    Looks like I have a similar issue here.

    Other / Objects end up grabbing a lot of memory (0.59 GB and counting) and make the build crash on iOS - Happens at startup when the app is loading the scene:

    Screenshot 2021-08-03 at 20.11.13.png
    Memory Profiler capture (Tested with iOS 14.6 iPhone X, Build with Unity 2020.3.0f1 and Xcode 12.5.1).

    Anything I can try to avoid this? Thanks.
     
  28. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    MartinTilo likes this.
  29. piegaro

    piegaro

    Joined:
    May 17, 2017
    Posts:
    10
    Ok thanks, done here
     
    MartinTilo likes this.
  30. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    I was able to strip a lot of stuff from the project and submit a bug-report with a project that can be used to 100% reproduce the problem. It took me a few days, so I hope it leads to a solution :)

    (Case 1361433) 2019.4: "Other > Objects" leaking memory

    I would appreciate if you can take a look at it and tell me what objects are actually leaking, hoping the leak is on my side and I can fix it.
     
  31. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    @MartinTilo @alexrvn Can you please acknowledge that you saw the post and you're aware that a bug-report for this issue exists now? Thank you :)
     
    alexrvn and MartinTilo like this.
  32. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,461
    Hi Peter,
    Apologies for the silence. I had seen it, pinged the team chat about it and linked up the bug and this thread at the time but I was kinda on the jump and forgot to even just leave a "like".
    We've been a bit heads down in pushing out 0.4.0 of the memory profiler as well so I had left it with QA for the moment. We've been digging around a bit in the native Object and roots code lately so this bug gives us an opportunity to evaluate the questionable things we've seen a bit more closely still and see if we can fix this quickly.
     
    phobos2077 and Peter77 like this.
  33. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    Thank you for the reply, much appreciated :)

    If you find what's causing it, I would appreciate if you can let me know what it is. Perhaps the issue is on my side rather than engine-side, but just hidden under "Other Objects".

    In this case I would like to fix it as soon as possible, without having to wait for the Profiler fix.
     
    MartinTilo likes this.
  34. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
  35. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
  36. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,461
    Hey Peter,

    My apologies for the delayed response. I had not forgotten about this thread. I've tried to get some clarity on where or what might've fixed this and thought I saw it still on 2019.4.35 and latest Addressables package version myself, but on double checking, found that it only goes from 18B -> 62B (on PC) or 18B ->38B (Android) and then stays there.

    So I have to confirm: While it's unfortunate to have anything at all listed under Others>Objects, the leak seems to be fixed and backported. I have to assume it was fixed as part of another bug fix and it's unfortunate that we don't know which one exactly, there is now rather deminishing returns on further efforts to investigate this.

    And getting Others>Objects all the way to 0 might have to be something we tackle as we go forward with the Memory Profiler package and implementing the needed changes for that in the Memory Manager.

    We'll still have a think about what to do about the bug ticket but I thought I'd let you know of the current status already, as with that, there should at least in regards to the leak be no further impediment for you to continue on with 2019.4 :)