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. Dismiss Notice

Bug Burst 1.8.7 consumes insane amount of memory and super long compilation time

Discussion in 'Burst' started by optimise, Jun 15, 2023.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,024
    It seems like Burst 1.8.7 when compile dots project code, not only it consumes insane amount of memory but also stuck at completing domain for very long time like over 2 minutes and sometimes can reach near to 10 minutes. Sometimes it just stay there compile forever. Previously at 1.8.4, I believe it's only takes 30 seconds+ most of time and also not consume so much memory.

    upload_2023-6-15_23-51-7.png

    upload_2023-6-16_0-2-17.png
     
    Last edited: Jun 15, 2023
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    If there is a clear before and after, please file a bug report
     
  3. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    282
  4. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    282
    @optimise I'm wondering whether this is related to, when you upgrade to a new version of Burst, it needs to recompile everything to repopulate the cache. Have you continued to see this problem or has it gone away?
     
  5. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,024
    I still continued to see this problem. Not only each time changing code takes long time to compile, quite frequently editor will just forever stay there compiling and I need to just kill editor and reopen it again. Not really sure but it seems like editor memory usage keep growing when compiling code that sometimes will log out of memory error.
     
  6. mm_hohu

    mm_hohu

    Joined:
    Jun 4, 2021
    Posts:
    38
    I have experienced similar problems.
    Code (CSharp):
    1. #if BURST_UTILITY_SAFETY_CHECKS
    2.             if (length <= 0)
    3.             {
    4.                 Debug.LogError($"BurstAllocation<T> Alloc<T>: The length of BurstAllocation {length} is invalid.");
    5.                 return default;
    6.             }
    7. #endif
    In my case, I have my own safety checks using symbol definitions as described above, and when I disabled all of them, the compile time improved drastically from a couple of minutes to 10 seconds.

    My guess at this point is that the string binary cache, etc., is being inline-expanded and copied in every calling method, which I suspect is causing the compile volume to expand.

    However, I have no evidence.
     
  7. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    282
    Thank you @optimise and @mm_hohu. We have found a performance regression in 1.8.7 that could lead to increased compile times. The performance regression happens even when Burst has already compiled and cached everything. We'll get it fixed as soon as we can.
     
    optimise, Laicasaane and mm_hohu like this.
  8. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,024
    Awesome. Btw for huge memory usage issue, is that caused by burst 1.8.7 too? For the mobile project I working on does not have hdrp level graphics that I believe should less than 5 GB but currently it consume memory until nearly 10 GB and editor keep freezing or crashing.
     
  9. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    282
    @optimise it's likely that yes, it's the same underlying issue in 1.8.7 that also causes the increased compile times.
     
    optimise likes this.