Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

"Temp Job" Native Memory Region Entries using Memory Profiler on iOS

Discussion in 'Profiler Previews' started by VictorChow_K, Jun 5, 2020.

  1. VictorChow_K


    Jan 16, 2019
    (Not sure if this is the correct forum, but perhaps I can be directed to the correct sub-forum)

    I'm trying to reconcile the difference in memory used after some development and an upgrade from 2018.4.14f1 to 2019.3.10f1 on iOS. For example, at our title screen on a particular device, there is an 80-100MB increase due to more than just content changes.

    In the Memory Profiler's Table / Diff Raw Data / Native Memory Region, it lists a number of ALLOC_TEMP_JOB_ASYNC and Stack Allocator: ALLOC_TEMP_THREAD line items under Native Memory region that could account for ~35MB. They don't exist in 2018-- the closest items are labeled ALLOC_TEMP_JOB and they are significantly fewer and smaller.

    1. Is there any way to dig deeper into where these were allocated or what system these could have originated from? There is a parentIndex and addressBase label but it's hard to trace these back to anything meaningful.
    2. Is there any way to cross-examine this with an Instruments Allocation profile?
  2. MartinTilo


    Unity Technologies

    Aug 16, 2017
    Hi Victor,
    There is not too much info you can derive from this currently, which is something we'll have to address in the future. For now, what this can tell you is that
    • ALLOC_TEMP_JOB_ASYNC is the label for an allocator used for async operation jobs like e.g. async scene and asset loading
    • ALLOC_TEMP_THREAD is the label for an allocator used for temporary allocations on a per-thread basis (including main thread) and only available from native code
    So I'd suspect that some changes in how stuff gets loaded by Unity changed and causes more allocations here, likely to the benefit of faster load times...

    Using Instruments Allocation profile might get you some more insights but I'm sadly not firm enough on that to be able to give you any pointers or how to make sense of it.
    VictorChow_K likes this.