Search Unity

Bug Fatal Error: Could not allocate memory

Discussion in 'Editor & General Support' started by BIGTIMEMASTER, Apr 16, 2020.

  1. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    I am getting this error consistently (reproduced 6 times in a row) after approximately 1 hour of letting my game run in editor.

    I was using 2019.2.5f1, then upgrade to 2019.2.21f1 to see if that would solve this issue. Packages involved are: collections, mathematics, jobs, burst. They are all updated to latest versions.

    The main components in my game are unity terrains and Vegetation STudio pro. I am in contact with the author of Vegetation Studio, but he believes this error could be due to either a bug or perhaps some internal memory cap that unity might be reaching.

    upload_2020-4-16_11-5-34.png

    Here is typical performance:
    upload_2020-4-16_11-9-58.png

    There is small hiccups as a new terrain detail batch is loaded, but mostly it is consistent. The only consistency I can identify with this error is that it happens after about 40-60 minutes of running the game in play mode in editor.

    I have tried reducing the total amount of terrains by 50%, but this made no difference in performance, and the crash/error still happens. Any advice is appreciated.
     
    Last edited: Apr 16, 2020
  2. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    It looks like there is such thing as a memory profiler. I'll see if we can get that running and try to pinpoint where this problem is happening.
     
    Joe-Censored likes this.
  3. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,455
    Could be a memory leak. Check the Workflow for
    Finding and fixing small continuous allocations during application lifetime. And also check the Memory Map Diff view and By Alloc Diff tables, in the later look for Native Array, those allocations are not Object allocations and wouldn't show up in the Tree Map or Objects tables and according to that popup, Native Arrays leaking might be what's going on here.

    If taking and opening snapshots takes too long, you might want to update to 2019.3
     
    BIGTIMEMASTER likes this.