Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

JobTempAlloc has allocations that are more than 4 frames old

Discussion in 'iOS and tvOS' started by dcecar, Jun 11, 2019.

  1. dcecar

    dcecar

    Joined:
    Dec 7, 2016
    Posts:
    2
    I get these errors on the console in xcode:


    Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
    (Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 539)
    To Debug, enable the define: TLA_DEBUG_STACK_LEAK in ThreadsafeLinearAllocator.cpp. This will output the callstacks of the leaked allocations
    (Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 541)
    also...

    Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 12)
    (Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 313)

    I don't use Jobs or async operations except for LoadSceneAsync and UnloadSceneAsync.

    The errors are intermittent, there will be a period when it spams the console, then a period of nothing.. then a few here and there.. then spam again etc. I have been trying to eliminate objects that might be causing it, but it seems like multiple things can cause it. I've had it go away when I disable the 1 directional light with shadow, some particle effects, or line renderers, but it's not constantly a single type of object.

    Only happening on IOS. I am testing on Iphone 6+. Windows/Editor and Mac/Editor do not have the issue.

    Unity version 2019.1.5f1 (6f1140cf2297)

    It would be really useful for Unity to allow us to enable some debug flag that would let us track where these allocations come from, because as it is now its internal and we have no way of debugging this that i know.
     
  2. kahyong_unity

    kahyong_unity

    Unity Technologies

    Joined:
    Jan 17, 2019
    Posts:
    2
    Are you able to send us a link to your repro project for this?
     
  3. dcecar

    dcecar

    Joined:
    Dec 7, 2016
    Posts:
    2
    I will get this to you later today. thanks
     
  4. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    201
    Any update on this? I am having the same issue.
     
    jumasudo likes this.
  5. dyox

    dyox

    Joined:
    Aug 19, 2011
    Posts:
    552
    Same issue on 2019.3.0a11
     
  6. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    382
    We're also getting hundreds of these messages spamming the console using 2019.1.x (currently 2019.1.14f1) on some devices (eg. iPhone 5s, iOS 12.3.x) but not so many on others (eg. iPhone 8, X).
     
    Last edited: Aug 22, 2019
  7. Jbs_GameZone

    Jbs_GameZone

    Joined:
    Dec 14, 2018
    Posts:
    106
    Same issue here, using Unity 2019.2.1f1 with Xcode 11 (beta 5). Testing on low end devices Iphone6 IOS 11 & 6 Plus IOS 12.4.
    It is a pain in the neck to debug, blindly commenting out different parts of the scripts and testing. A stacktrace would be great to locate them precisely.

    Update:
    -One reason was casting or receiving shadows on meshes (or particles). After disabling them it was ok.

    -But, there are other cases, now I notice that it occurs if I have a second (or third) active camera in scene that renders on render texture (car mirrors). If I disable the mirrors the game plays for hours without a glitch. If I enable them it throws this err in the first minutes.
     
    Last edited: Aug 22, 2019
    clinton_d likes this.
  8. Feelnside

    Feelnside

    Joined:
    Sep 30, 2016
    Posts:
    58
    I'm having the same issue (Unity 2019.1, the all versions I have used, currently it's on Unity 2019.1.14f; iPhone 5s, iOS 12.4).
     
  9. clinton_d

    clinton_d

    Joined:
    Feb 11, 2011
    Posts:
    17
    THANKYOU THANKYOU THANKYOU!!

    Shadow casting was causing the issue for me.

    Specifically, my newer test devices were not throwing any erroneous logs when running on XCode. So everything was looking good for release. My final check involves testing on older (and still dominant) devices. At which point the logs started being clogged with this issue.

    Disabling shadows for the older devices solved the issue.

    In future, I'll continue to do my primary dev on the older devices ...
     
    Jbs_GameZone likes this.
  10. AurimasA

    AurimasA

    Unity Technologies

    Joined:
    Apr 24, 2017
    Posts:
    24
    Hello everyone, could someone submit a bug report regarding "Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak" errors on iOS and post the bug ID here?
     
    Conferno likes this.
  11. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    382
    Jbs_GameZone and Conferno like this.
  12. BuzzJive

    BuzzJive

    Joined:
    Mar 6, 2014
    Posts:
    22
    Seeing this on tvOS as well - definitely with the Apple TV HD. I hope the repro above can be used to fix it there as well.
     
  13. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    201
    So if a null error is thrown preventing a TempJob from being disposed in a round you will get this error. It will also keep stacking and not go away until you reboot the unity editor because the editor is tracking the thing you didn't dispose.

    If you get it a lot after restarting then I done know what can be done.
     
  14. BuzzJive

    BuzzJive

    Joined:
    Mar 6, 2014
    Posts:
    22
    As followup - we are absolutely not running any Jobs code ourselves, but clearly there's some internal stuff running it. This message also went away when I disabled the shadows completely.
     
  15. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    201
    @BuzzJive Totally, do you get it even if you've had no errors in the editor? Cause the internal stuff will get interrupted by an error and would get that job error. Just want a better stack trace for this...
     
  16. BuzzJive

    BuzzJive

    Joined:
    Mar 6, 2014
    Posts:
    22
    @8bitgoose I think I understand what you are asking. There are no errors in our game at the time. Other platforms are running everything as expected. tvOS is running as expected as well, but it throws this Job Tempalloc error from seemingly nowhere - sometimes just occasionally, sometimes flooding the logs.
     
  17. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    201
    @BuzzJive Ah thanks for the confirmation. It took me weeks to figure out why it was happening and many posts before I realize what I was doing wrong. Pretty rough if you aren't even touching the jobs systems :(.
     
  18. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    382
    Unity QA could not replicate the problem in my bug report (1182525). If anyone has a repro case handy please bug report it and reference case 1182525. I'll try to make a repro for it when I get a moment.
     
  19. brianchasalow

    brianchasalow

    Joined:
    Jun 3, 2010
    Posts:
    201
    Any news on this? I'm seeing this spam in my ARKit app as well, iOS 13, Xcode 11 GM 2. iPhone X. Unity 2019.2.6f1
     
  20. Numa

    Numa

    Joined:
    Oct 7, 2014
    Posts:
    54
    @greg-harding From what I've seen it starts happening when the device starts lagging / overheating. On older ipads I get this warning almost constantly, but on an iPhone XS I only get it after a while once the phone has overheated and everything starts to get out of sync. So if they try to reproduce it with a very simple project and a cube on a recent device, they will never encounter the problem. If you have time try to give them a scene with 1,000,000 triangles + a bunch of post processing effects, lots of game objects with busy Update() methods, and tell them to test it on an iPhone 6S :D
     
  21. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    382
    Yeah, as soon as I run anything on an iPhone 5s or iPad Air (original) it throws these errors. I haven't had time to repro it yet but adding a sceneload of stuff should do the trick :)
     
  22. Forberg

    Forberg

    Joined:
    Oct 27, 2018
    Posts:
    7
    Getting this spam on the console randomly. Not using the Job System at all. Once the spam starts the framerate drops and the memory starts filling up.
     
  23. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    201
    I found that if my game ran with too high a frame rate these would pile up. Try limiting your frame rate to whatever the screen refresh is and see if that helps.
     
  24. Forberg

    Forberg

    Joined:
    Oct 27, 2018
    Posts:
    7
    Thanks will give it a try, I am indeed running with pretty high framerate

    Set Application. targetFrameRate = 120.
    Aaand I think that fixed it! Was having this issue for weeks and already had nightmares about it! Thank you so much!