Search Unity

Unity crashing with Size Overflow In Allocator error

Discussion in 'Burst' started by Crawdad, Feb 2, 2022.

  1. Crawdad

    Crawdad

    Joined:
    Nov 23, 2016
    Posts:
    174
    Hey, guys. I've been working on a basic pathfinding script using DOTS, and I've run into a brick wall. The script runs fine as long as I'm not iterating the job too frequently, but when I start iterating it more quickly, Unity crashes with the following error. Can't for the life of me figure out what's going on. I found a forum recommending deleting the temp and library folders, as well as clearing the GI Cache, but none of these worked for me. Hoping someone might be able to nudge me in the right direction on this one. It's a very simple project, so I don't believe anything in the scene itself is causing it. And as I said, it runs fine as long as I don't iterate the job too quickly.

    Edit: The job takes about 2 milliseconds to run, but if I iterate more frequently than 250 milliseconds, it crashes. I also attempted to remove and reinstall the Entities package, but that didn't help.

    Edit: Realized I wasn't using the latest version of unity so updated the project. It still crashes but now doesn't even bother throwing an error. Found this in the edit log "
    Size overflow in allocator.
    Cancelling DisplayDialog because it was run from a thread that is not the main thread: Fatal Error! Size overflow in allocator."

    SizeOverflow.PNG
     
    Last edited: Feb 2, 2022
  2. Crawdad

    Crawdad

    Joined:
    Nov 23, 2016
    Posts:
    174
    Strangely enough, I've narrowed the issue down to the players movement. Everything else functions properly and run smoothly as long as I'm not moving the player. Please see line 12 below. Suggestions on why this could be happening are appreciated.

    Code (CSharp):
    1.     void Movement()
    2.     {
    3.         if (path.Length > 0)
    4.         {
    5.             int limit = path.Length - 1;
    6.  
    7.             float3 currentPos = new float3(transform.position);
    8.             float3 destination = nodePositions[path[limit - step]];
    9.             float distance = GetDistance(currentPos, nodePositions[path[limit - step]]);
    10.  
    11.             transform.LookAt(nodePositions[path[limit - step]]);
    12.             transform.position = Vector3.MoveTowards(transform.position, destination, (speed * Time.deltaTime));
    13.  
    14.             if (distance < 0.1f && step < limit)
    15.             {
    16.                 step++;
    17.             }
    18.         }
    19.     }
    20.  
     
  3. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
  4. Crawdad

    Crawdad

    Joined:
    Nov 23, 2016
    Posts:
    174
    sheredom likes this.
  5. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    No problem! Always happy to help :)
     
  6. Crawdad

    Crawdad

    Joined:
    Nov 23, 2016
    Posts:
    174
    Thread moved here.
     
    sheredom likes this.