Search Unity

Where does 4 frames old alloc warning come from?

Discussion in 'Entity Component System' started by Bas-Smit, Jul 17, 2019.

  1. Bas-Smit

    Bas-Smit

    Joined:
    Dec 23, 2012
    Posts:
    274
    Hi, Im seeing a pair of these warning per frame, any chance I can find out where they are coming from? There is no further information in the console. I tried full stacktraces (both in leak detection and playersettings), but to no avail. Im on 2019.1.2 with latest packages.

    Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak

    To Debug, enable the define: TLA_DEBUG_STACK_LEAK in ThreadsafeLinearAllocator.cpp. This will output the callstacks of the leaked allocations

    Cheers, Bas
     
  2. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    Well known issue. Read through the following thread (if spam filter allows), see if anything works. If not, I just toggle off warnings. Hasnt caused anything wrong so far if I restart Unity Editor after every play session.

    Spam filter eats the link. Google: [Jobs][Lags] JobTempAlloc has allocations that are more than 4 frames old
     
    Bas-Smit likes this.
  3. Vaspra

    Vaspra

    Joined:
    Apr 15, 2018
    Posts:
    34
    Make sure you're definitely calling m_YourNativeArray.Dispose() when you're done with whatever you need it for. For me this happens when I have an undisposed native array lying around.

    Worse, someone correct me if this is wrong but if you start up a NativeArray, cause an exception, fix the issue to dispose it properly in your code, then try again - the previous array can still be floating around until the project is reloaded.

    Still new to this stuff myself but this has solved my problems a few times, good luck!
     
    Bas-Smit likes this.