Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

What means "MemoryManager.FallbackAllocation" in Profiler?

Discussion in 'Data Oriented Technology Stack' started by daschatten, Jan 13, 2020.

  1. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    Profiler shows a lot of MemoryManager.FallbackAllocations with my bursted path finding job. What do they mean?
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,062
    You allocating native containers inside job I guess
     
    MNNoxMortem likes this.
  3. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    Yes, i do this... thanks!
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    893
    It means the allocator you're allocating under are filled to the brim and you're falling back on slower allocators
     
    GilCat likes this.
  5. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,220
    this code doesn't use jobs at all, why do I have this?

    upload_2020-6-23_18-4-27.png

    (it's doing a lot of compute.dispatch though)

    @MartinTilo
     

    Attached Files:

  6. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    893
    Don't know about compute.dispatch but are there any other Allocation markers in there? Nothing keeps you from e.g. allocating NativeArrays with the Temp allocator and running out space on that allocator. Whitin Jobs or outside like here.
     
  7. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,220
    I am pretty sure that that code doesn't use native containers, but I'll double check later.
     
  8. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,220
    @MartinTilo as you can see from this deep profile, the allocation comes from the internal unity API. You also notice that really would like to save that 1.20ms if it's caused just by it. Should we open a bug or something?

    upload_2020-6-24_8-50-17.png

    I have also notice that every combine dependency causes one of those

    upload_2020-6-24_8-52-24.png

    to be honest I feel disappointed that unity eats up precious ms in code that is supposed to be super optimized.

    if the solution is a simple as you say (the buffer is not big enough), it would be useful for the user to set up the max size of the buffer. Also the falling back to a slower allocation may need to be optional, as I may prefer actually to be warned about the temp buffer being full.
     

    Attached Files:

    Last edited: Jun 24, 2020
  9. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    893
    Yes please. Also maybe additionally raise this particular issue in a new thread on the Graphics subforum, as I have not enough insight into those APIs to provide much more info on this.
     
  10. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    386
    I get MemoryManager.FallbackAllocations when I update systems several times in one frame.
     
  11. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,220
    Got the info I was looking for, thanks anyway!
     
    Last edited: Jun 30, 2020
  12. hidingspot

    hidingspot

    Joined:
    Apr 27, 2011
    Posts:
    72
    Can you share your insights?
     
  13. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,220
    there is nothing special to share, only confirmation that I am not crazy at the moment. I found out that I can set the temp buffer size with Profiler.SetTempAllocatorRequestedSize and that doesn't solve my problem. So there is a bug, but I can't pin it down. I am going to open a bug report.
     
    Last edited: Jun 30, 2020
unityunity