Search Unity

[Jobs][Lags] JobTempAlloc has allocations that are more than 4 frames old

Discussion in 'Data Oriented Technology Stack' started by dyox, Jan 18, 2018.

  1. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,973
    Sorry was meant to reply before but got caught up.

    So yeah the majority of the time this warning shows up it has nothing to do with container allocations and the message itself really gives you no feedback which is why it's such a confusing warning. From experience though, it's nearly always an issue with jobs and jobhandles, usually one being lost due to a different path in code being taken.

    It sounds like your issue might relate to some internal jobs related to the frame debugger, might want to file a bug report in that case.
     
    MNNoxMortem likes this.
  2. GuardHei

    GuardHei

    Joined:
    Feb 10, 2018
    Posts:
    55
    Yes. And after more tests, it is clear that it is the problem of using SRP batchers with Frame Debugger. Turning off the SRP batchers makes everything fine.
     
    xoodZ likes this.
  3. Przemyslaw_Zaworski

    Przemyslaw_Zaworski

    Joined:
    Jun 9, 2017
    Posts:
    183
    I experienced "JobTempAlloc..." warning with Addressable Asset System when I use textures with enabled option "Use Crunch Compression", both under Unity 2018 and 2019. Disable crunch compression fixed a problem for me.
     
  4. xoodZ

    xoodZ

    Joined:
    Jan 8, 2018
    Posts:
    17
    I also saw these errors in the console after the project was transferred to 2019.2. Previously, in 2018.4 these errors were not.
    I also get errors if the game is running, the statistics window is on, and I move objects in the scene.
    Disabling the statistics window and restarting Unity helped me.
     
  5. laeusnb

    laeusnb

    Joined:
    Jun 10, 2014
    Posts:
    69
    I'm seeing a report in the wild with massive "Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak" etc spam in the output log. It's a final build using Unity 2018.4.2f1. Anything I can do with this? Super hesitant to upgrade a shipping project to Unity 2019+, but if it's necessary, it can be done.

    Edit: this player's entire machine freezes, forcing a full restart.
    Edit 2: not using ECS or job system or any similar fancy stuff, and not seeing a single reference to job stuff when doing Find All in my solution.
     
    Last edited: Jan 31, 2020
  6. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    207
    @laeusnb When you say, out in the wild, do you mean in production run. If a temp job is created in a fixed update frame and then 4 regular update frames are run before the next fixed update frame (where the frame can be disposed) this will pop up. I found limiting my frame rate via VSync fixed this issue.
     
  7. laeusnb

    laeusnb

    Joined:
    Jun 10, 2014
    Posts:
    69
    Thanks -- I mean, a pre-release Steam build of the game. I also should have mentioned (and added an Edit) that I'm not using the job system or ECS at all.
     
  8. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,115
    Do you use the async navmesh package? I think that's where mine stem from. It's always just been an annoyance though, I've never had any crashes or user problems.
     
  9. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    561
    Yeah I get this message when using async back navmesh at runtime, not sure how to get rid of it
     
  10. kingstone426

    kingstone426

    Joined:
    Jun 21, 2013
    Posts:
    36
    I would also strongly advice against upgrading when close to release. Try pinpointing the problem. Can you reproduce the problem on your machine? The 4 frames warning may occur only on slower machines due to jobs taking more frames to complete, so maybe you can mimic your player's specs and setup.

    Also, Unity uses ECS under the hood for some stuff, and as others have mentioned, async navmesh baking is known to produce these warnings. But for me at least, it has not caused a complete freeze. It might be possible that the freeze and warnings are unrelated.
     
  11. dyox

    dyox

    Joined:
    Aug 19, 2011
    Posts:
    566
    It happens on high fps too.
    High or low config.
    4 frames, it's just not enough.
     
  12. laeusnb

    laeusnb

    Joined:
    Jun 10, 2014
    Posts:
    69
    I cannot reproduce it on my machine at all (and have had no reports of freezing/crashing from other playtesters). This player has a pretty beefy machine. I'll keep digging to see what it is. I do not use async navmesh. Thanks for the input.
     
  13. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    207
    If the player has a beefy machine, means his framerate is too high and some job Unity has created (probably in the fixed update part) is not being disposed within four Update frames. I wish they would fix this and not spam the console with this message. Or allow us to up the warning to 10 - 20 frames.
     
    laeusnb, dyox and malkere like this.
  14. Isuroku

    Isuroku

    Joined:
    Jul 23, 2015
    Posts:
    1
    I had this warning: "Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 12)" until I closed Tab Profiler. May be it's help somebody.
     
unityunity