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

"Dynamic array capacity overflow" when loading scene directly

Discussion in 'Editor & General Support' started by Immanuel-Scholz, Jan 11, 2016.

  1. Immanuel-Scholz

    Immanuel-Scholz

    Joined:
    Jun 8, 2013
    Posts:
    221
    Hi,

    before I start trying to cut down our 60gig project to get some reasonable test to submit a bug report.......

    Anyone seen a freeze of Unity 5.3.1p2 (happened since around 5.3.0) when loading certain scene files directly during startup of the editor? In the log, there is some complaining about an array overflow that looks like someone allocates a negative number. (see below).

    Odd thing is, when I load the project in an empty scene and then switch to the same other scene, it works fine.

    Code (csharp):
    1.  
    2. System memory in use before: 329.6 MB.
    3. System memory in use after: 329.9 MB.
    4.  
    5. Unloading 391 unused Assets to reduce memory usage. Loaded Objects now: 50141.
    6. Total: 116.965454 ms (FindLiveObjects: 2.913556 ms CreateObjectMapping: 4.025609 ms MarkObjects: 107.759018 ms  DeleteObjects: 2.264556 ms)
    7.  
    8. Load scene 'Assets/Test/ImiTest/ImiTest.unity' time: 12174.025391 ms
    9. <RI> Initializing input.
    10.  
    11. <RI> Input initialized.
    12.  
    13. Dynamic array capacity overflow: 0xffffffffa06ab84c
    14. (Filename: C:\buildslave\unity\build\Runtime/Utilities/dynamic_array.h Line: 248)
    15.  
    16. owns_data()
    17. (Filename: C:\buildslave\unity\build\Runtime/Utilities/dynamic_array.h Line: 381)
    18.  
    19. DynamicHeapAllocator allocation probe 1 failed - Could not get memory for large allocation 18446744060880601727.
    20. DynamicHeapAllocator allocation probe 2 failed - Could not get memory for large allocation 18446744060880601727.
    21. DynamicHeapAllocator allocation probe 3 failed - Could not get memory for large allocation 18446744060880601727.
    22. DynamicHeapAllocator allocation probe 4 failed - Could not get memory for large allocation 18446744060880601727.
    23. DynamicHeapAllocator out of memory - Could not get memory for large allocation 18446744060880601727!
    24. Could not allocate memory: System out of memory!
    25. Trying to allocate: 18446744060880601727B with 16 alignment. MemoryLabel: TempOverflow
    26. Allocation happend at: Line:133 in C:/buildslave/unity/build/Runtime/Allocator/ThreadsafeLinearAllocator.cpp
    27. Memory overview
    28.  
    29. [ ALLOC_DEFAULT ] used: 173125936B | peak: 0B | reserved: 213909504B
    30. [ ALLOC_TEMP_JOB ] used: 490217B | peak: 0B | reserved: 5242880B
    31. [ ALLOC_GFX ] used: 69777218B | peak: 0B | reserved: 84585314B
    32. [ ALLOC_CACHEOBJECTS ] used: 61288824B | peak: 0B | reserved: 111149056B
    33. [ ALLOC_TYPETREE ] used: 20488008B | peak: 0B | reserved: 34603008B
    34. [ ALLOC_PROFILER ] used: 47552B | peak: 0B | reserved: 8388608B
    35. Could not allocate memory: System out of memory!
    36. Trying to allocate: 18446744060880601727B with 16 alignment. MemoryLabel: TempOverflow
    37. Allocation happend at: Line:133 in C:/buildslave/unity/build/Runtime/Allocator/ThreadsafeLinearAllocator.cpp
    38. Memory overview
    39.  
    40. [ ALLOC_DEFAULT ] used: 173125936B | peak: 0B | reserved: 213909504B
    41. [ ALLOC_TEMP_JOB ] used: 490217B | peak: 0B | reserved: 5242880B
    42. [ ALLOC_GFX ] used: 69777218B | peak: 0B | reserved: 84585314B
    43. [ ALLOC_CACHEOBJECTS ] used: 61288824B | peak: 0B | reserved: 111149056B
    44. [ ALLOC_TYPETREE ] used: 20488008B | peak: 0B | reserved: 34603008B
    45. [ ALLOC_PROFILER ] used: 47552B | peak: 0B | reserved: 8388608B
    46.  
    47. (Filename: C:/buildslave/unity/build/Runtime/Allocator/MemoryManager.cpp Line: 982)
    48.  
     
  2. AngryMuppet

    AngryMuppet

    Joined:
    Mar 28, 2014
    Posts:
    34
    Yep - our project has just started doing this too - very similar output. Seems to happen in both 5.2.4f1 and 5.3.1p3.

    Clearing out the Library folder is a temp fix for us.
     
  3. topherr

    topherr

    Joined:
    Jun 1, 2013
    Posts:
    25
    I'm also getting this, but not when loading a scene. It's while creating and destroying HyperText objects.

    Code (csharp):
    1.  
    2. Dynamic array capacity overflow: 0xfffffffffffffffe
    3.  
    4. (Filename: C:\buildslave\unity\build\Runtime/Utilities/dynamic_array.h Line: 248)
    5.  
    6. owns_data()
    7.  
    8. (Filename: C:\buildslave\unity\build\Runtime/Utilities/dynamic_array.h Line: 381)
    9.  
    10. Overflow in memory allocator
    11.  
    12. (Filename: C:/buildslave/unity/build/Runtime/Allocator/MemoryManager.cpp Line: 1020)
    13.  
    14. GetApplication().MayUpdate()
    15.  
    16. (Filename: C:/buildslave/unity/build/Editor/Platform/Windows/EditorWindows.cpp Line: 2325)
     
  4. topherr

    topherr

    Joined:
    Jun 1, 2013
    Posts:
    25
    I've made a stand-alone Development build, and attached the VS debugger to get a CPP callstack. Here is the result of the crash:

    Code (csharp):
    1.  
    2. >    Test.exe!UI::DepthSortGrid::AddAndGetDepthFor(const UI::RenderableUIInstruction & instruction, const UI::RenderableUIInstruction * inputInstructions) Line 189    C++
    3.     Test.exe!UI::PrepareDepthEntries(const UI::RenderableUIInstruction * uiInstruction, unsigned int count, UI::DepthSortEntry * output) Line 241    C++
    4.     Test.exe!UI::SortForBatching(const UI::RenderableUIInstruction * inputInstructions, int count, UI::RenderableUIInstruction * outputInstructions) Line 260    C++
    5.     Test.exe!UI::SortForBatchingJob(UI::SortingJobData * data) Line 151    C++
    6.     Test.exe!JobQueue::Exec(JobInfo * info, __int64 tag, int count) Line 347    C++
    7.     Test.exe!JobQueue::ProcessJobs(void * profInfo, bool * insideFrame) Line 717    C++
    8.     Test.exe!JobQueue::WorkLoop(void * data) Line 759    C++
    9.     Test.exe!Thread::RunThreadWrapper(void * ptr) Line 44    C++
    10.  
    And I've made a core dump, here: http://we.tl/po735Zvm31
    Here is the crash report from the game: http://we.tl/RBGllgktaA
     
    Last edited: Jan 18, 2016
  5. topherr

    topherr

    Joined:
    Jun 1, 2013
    Posts:
    25
    Final addition, we've managed to work-around this crash by enabling "alignByGeometry" in the TextGenerator. Hope this gives you Unity devs enough info to figure out the crash.
     
  6. dominicjackson

    dominicjackson

    Joined:
    Feb 11, 2013
    Posts:
    8
    Did anything happen with this? - this seems like a problem with the text rendering - I'm seeing pretty much the same thing as described above and from my initial tests it looks like the problem disappears when selecting "alignByGeometry" on one of our icon prefabs that also contains a text field. I'm using 5.3.3f1 for what it's worth
     
  7. Moven

    Moven

    Joined:
    Nov 30, 2017
    Posts:
    3
    Great thanks for your inspiration ! We found the ContentSizeFitter component attached to Text node will also cause crash traced by "UI:depthSortGrid::AddAndGetDepthFor", especially at the first UI at startup. That puzzled really a long time.