Search Unity

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

Discussion in 'Entity Component System and C# Job system' started by dyox, Jan 18, 2018.

  1. Hans-D

    Hans-D

    Joined:
    Sep 24, 2013
    Posts:
    32
    I'm glad the 4 frames limit on jobs is being removed, it's something that severely limits the use cases of jobs where they would otherwise be ideal. It also ties your code to the framerate, causing all sorts of "different hardware" problems. Say your job takes 30ms to finish; no bug at 60FPS, hard to track bug at 144FPS.
     
  2. LightYarn

    LightYarn

    Joined:
    Nov 18, 2012
    Posts:
    55
    After some research I found another case when this problem occurs. In our case while using WebGL and the Particle System..... kind of like @castor76 problem but slightly different.

    I'm using Unity 2018.3.0f2

    Here are some details of the bug-report

    EDIT: It's even simpler. Just publish an empty scene with fresh out-of-the-box particle system and (de)activate the Trail-Module. If active it will trigger the error.
     
    Last edited: Jan 4, 2019
  3. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,649
    Would you please submit a bug report and post the bug number here?
     
  4. EssencyStudios

    EssencyStudios

    Joined:
    May 18, 2018
    Posts:
    5
    I'm having this issue and between the hundreds of "JobTempAlloc has allocations that are more than 4 frames old.."
    it says "To Debug, enable the define: TLA_DEBUG_STACK_LEAK in ThreadsafeLinearAllocator.cpp. This will output the callstacks of the leaked allocations"

    Anyone figure out how to do this? I cant seem to.
    Here are some of those crash reports:

    one dude: https://pastebin.com/CcjPkuHj
    other dude: https://pastebin.com/Ce0TL821
    another dude: https://pastebin.com/CiNyXn04
     
  5. LightYarn

    LightYarn

    Joined:
    Nov 18, 2012
    Posts:
    55
    Peter77 likes this.
  6. LightYarn

    LightYarn

    Joined:
    Nov 18, 2012
    Posts:
    55
    Not fixed in 2018.3.1f1

    Build Target: WebGL
    Empty Scene -> New Particle System -> Active trails will trigger the error in build
     
  7. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    108
    That is some sad news - was happy to see a new build today but looking at the release notes I was kinda let down :(
     
  8. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    529
    Has this been fixed? I have the problem now in 2018.3 where its saying this in the browser:

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


    Then gives memory warnings

    UnityLoader.js:4 GC Warning: Repeated allocation of very large block (appr. size 7192576):
    printErr @ UnityLoader.js:4
    UnityLoader.js:4 May lead to memory leak and poor performance
    printErr @ UnityLoader.js:4
    UnityLoader.js:4 GC Warning: Repeated allocation of very large block (appr. size 3596288):
    printErr @ UnityLoader.js:4
    UnityLoader.js:4 May lead to memory leak and poor performance


    Then crashes because of out of memory
     
    LightYarn likes this.
  9. seldom

    seldom

    Joined:
    Dec 4, 2013
    Posts:
    105
    Same here. 2018.3.0f2 WebGL build spams the console with this error. Going back to 2018.2 makes it go away.
     
  10. JoleEh

    JoleEh

    Joined:
    Jan 29, 2017
    Posts:
    2
    Any estimate on when the 4 frame limit will be completed? Also would it be bad if i had jobs runnning for up to 15 seconds?
     
  11. LightYarn

    LightYarn

    Joined:
    Nov 18, 2012
    Posts:
    55
  12. LightYarn

    LightYarn

    Joined:
    Nov 18, 2012
    Posts:
    55

    Hey everyone:
    Version 2018.3.4 fixed the problem! *yaay* :)
     
  13. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    170
    ...it did? I am on 2018.3.4 and I'm here because I'm getting spammed by the warning right now.
     
  14. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,356
    We didn't fix anything relating to it in 2018.3.4.

    In 19.1 next week beta build has a fix.
     
    FROS7 likes this.
  15. LightYarn

    LightYarn

    Joined:
    Nov 18, 2012
    Posts:
    55
    @Joachim_Ante

    Well, your own patchnotes say that you did :confused:

    Unbenannt.PNG

    And I tested it: New scene -> add particle system -> activate trails -> build as WebGL -> no problem

    Maybe we are talking about two different problems?
     
  16. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,356
    I am pretty sure that that is specifically not the issue the thread was originally about.

    What is being discussed here is C# jobs in user projects that take longer than 1 frame causing the warning. That should be fixed in 19.1, i am sure the particle system specific issue indeed was fixed in 18.3 as the release notes state.
     
  17. Gregorik

    Gregorik

    Joined:
    Dec 11, 2014
    Posts:
    322
    Getting the same error all the time in 2018.3.5 when using a particle system.
     
  18. LightYarn

    LightYarn

    Joined:
    Nov 18, 2012
    Posts:
    55
    Ah, I see! Thank you for clarifying that.
    In my case the bug was indeed only about the particle system, I did not recognized any other problems regarding the job system. Sorry for mixing things up.
     
  19. BillBucky

    BillBucky

    Joined:
    Nov 4, 2016
    Posts:
    7
    Hello,

    This is still happening to me as well on Unity 2018.2.14f1. Any fixes for this, I don't believe I am using any job system.

    Thanks!
     
  20. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,356
    19.1 fixes it.
     
  21. alligator76

    alligator76

    Joined:
    Nov 24, 2018
    Posts:
    6
    Hello
    I get this problem with 2018.3.6f1, only when i enable "deep profile" in the profiler.
    I get even more message /details with 2019.1.0b4 and 2019.2.0a6.

    That happens randomly depending on the state of the project (sometimes disappears, sometimes come back), and greatly disturbs the profiler (FPS greatly reduced).

    I am not using jobsystem (but i tried it briefly and cancelled).
     
    Sylmerria likes this.
  22. Aeolus_Codes

    Aeolus_Codes

    Joined:
    Mar 6, 2019
    Posts:
    2
    I am having the same problem, even with no self-made code. Help?
     
  23. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    111
    Any chance of adding this fix to your only LTS release so far (2017.4)? Getting this bug when importing assets from the store.