Search Unity

Bug There are remaining Allocations on the JobTempAlloc. This is a leak...

Discussion in 'Editor & General Support' started by MichaelJT, Mar 16, 2023.

  1. MichaelJT

    MichaelJT

    Joined:
    Jan 28, 2015
    Posts:
    14
    So I'm getting this on two prefabs in particular:

    Any ideas on how to eliminate this issue so I can continue to work without out of memory issues?
     
  2. LuckedCoronet45

    LuckedCoronet45

    Joined:
    Feb 5, 2022
    Posts:
    4
    same issue... 2022.2.12
     
    Kristina_B likes this.
  3. therobby3

    therobby3

    Joined:
    Jan 30, 2019
    Posts:
    131
    Same here. My console is constantly getting flooded with these after updating from 2021 to 2022.
     
    Kristina_B likes this.
  4. MichaelJT

    MichaelJT

    Joined:
    Jan 28, 2015
    Posts:
    14
    I rolled back to 2021. Then scrapped entire project and started again because my code was an absolute mess. :(
     
  5. ManguGames

    ManguGames

    Joined:
    Sep 13, 2019
    Posts:
    2
  6. TomazMB

    TomazMB

    Joined:
    Oct 11, 2020
    Posts:
    38
    I get also the same messages in Console in version 2022.3.0 LTS (actually I got this messages for all versions 2022). There are 4 messages (see the picture). Later I see that my FPS start droping in my Game and it became slower and slower and I must restart the Unity.
    Bug Unity 2022_3_0_LTS-memory leak.png
     
    h4kdnb and Kristina_B like this.
  7. pheckinger

    pheckinger

    Joined:
    Jan 24, 2022
    Posts:
    5
    This is happening to me too. Just updated the project to 2022.3.1f1.
    Getting the warning people reported above related to "Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 6)".

    It goes away if I turn off our runtime navmesh build which calls NavMeshSurface.UpdateNavMesh(NavMeshData)
    ... which our game requires to react to runtime changes.

    Its happening in one other spot I havnt tracked down yet either, but the above navmesh one was 100% reproducible in the project.

    I am investigating this because I have user reports that the app is hard crashing for them when this section of code is being called and since its unity code I am looking at updates to fix it... so they may be related, but I cant seem to do anything about it currently.
     
    Last edited: Jun 7, 2023
  8. DreamyJester

    DreamyJester

    Joined:
    Feb 3, 2022
    Posts:
    1
    Do we already have a solution for this?
     
  9. BlackManatee

    BlackManatee

    Joined:
    Jun 13, 2013
    Posts:
    82
    Same problem in 2023.1

    This one occurred just after opening one of the Cinemachine example scenes.

    The problem only seems to happen when I click items in the project window. It does NOT seem to happen if I close the Inspector tab, only when I click various items in the Project tab and cause the Inspector contents to change.

    upload_2023-6-29_5-22-49.png
     
    Last edited: Jun 29, 2023
  10. khold93

    khold93

    Joined:
    Feb 11, 2020
    Posts:
    17
    Same problem here (version 2022.3.2f1). It started happening when I added a partical System into a prefab. Not saying it has anything to do with prefab or partical system, just noticed that it started to give leak warnings when I first worked with it. Never had this warning before.
    I don't have Cinemachine in this Project
     
  11. GediminasR

    GediminasR

    Unity Technologies

    Joined:
    Aug 19, 2021
    Posts:
    53
    Hello!

    Would you kindly please report this issue via the Bug Reporter tool?
    https://unity.com/releases/editor/qa/bug-reporting

    It would be great to take a look at this as to why this is happening.

    Please make sure to write the exact steps needed to be taken so that the reproduction would be visually seen. Also make sure to attach a reproduction project and any visual material so that when testing our CQA team can verify that they got the same results. If you can, please use this template:

    How to reproduce:
    1. Open the attached project
    2. Do this
    3. Do that
    4. Select this
    5. Observe that

    Expected result: Something is visible, something is printed or something happens
    Actual result: The opposite of what I expect happens

    Reproducible with: Editor version I am using (e.g: 2021.3.xf1)

    Reproduced on: The OS I am on (e.g: Windows 11, macOS Ventura 13.1 (Intel/Silicon))
     
    Yatchin and khold93 like this.
  12. bantus

    bantus

    Joined:
    Aug 16, 2017
    Posts:
    7
    same errors when I switch to 2022.2.12, the problem with sending a bug report is that fails too. it appears to impacting various items. :(
     
  13. GediminasR

    GediminasR

    Unity Technologies

    Joined:
    Aug 19, 2021
    Posts:
    53
    Hm, in that case try going through the Unity Hub, reporting through there
     
  14. ItsGonnaBeOk

    ItsGonnaBeOk

    Joined:
    Jul 14, 2016
    Posts:
    21
    I get this callstack after enabling validation:

    Code (CSharp):
    1. [Worker0] Allocation of 32 bytes at e020c760 in block 0 (frameIndex=1, lifetime=4, age=2, state=OK)
    2. 0x00007ff72a26f9eb (Unity) PlayableGraph::DestroyPlayableDeferred
    3. 0x00007ff72a6f6821 (Unity) Animator::ClearInternalControllerPlayable
    4. 0x00007ff72a6f6a39 (Unity) Animator::ClearObject
    5. 0x00007ff72a6f7abf (Unity) Animator::Deactivate
    6. 0x00007ff729c25835 (Unity) GameObject::ActivateAwakeRecursivelyInternal
    7. 0x00007ff729c25674 (Unity) GameObject::ActivateAwakeRecursivelyInternal
    8. 0x00007ff729c253f9 (Unity) GameObject::ActivateAwakeRecursively
    9. 0x00007ff729c28629 (Unity) GameObject::Deactivate
    10. 0x00007ff729fdeb90 (Unity) UnityScene::OnGameObjectChangedScene
    11. 0x00007ff72a1f10fd (Unity) SceneManagerBindings::MoveGameObjectToScene
    12. 0x00007ff7293dfba1 (Unity) SceneManager_CUSTOM_MoveGameObjectToScene_Injected
    13. 0x000002722f69b4e5 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.SceneManagement.SceneManager:MoveGameObjectToScene_Injected (UnityEngine.GameObject,UnityEngine.SceneManagement.Scene&)
    14. 0x000002722f69b40b (Mono JIT Code) UnityEngine.SceneManagement.SceneManager:MoveGameObjectToScene (UnityEngine.GameObject,UnityEngine.SceneManagement.Scene)
    15. 0x00000274724ffe03 (Mono JIT Code) UnityEditor.PreviewScene:AddManagedGO (UnityEngine.GameObject)
    16. 0x000002722f69ffc3 (Mono JIT Code) UnityEditor.PreviewRenderUtility:AddManagedGO (UnityEngine.GameObject)
    17. 0x000002722f69d9c3 (Mono JIT Code) UnityEditor.GameObjectInspector/PreviewData:UpdateGameObject (UnityEngine.Object)
    18. 0x000002722f6999db (Mono JIT Code) UnityEditor.GameObjectInspector/PreviewData:.ctor (UnityEngine.Object,bool)
    19. 0x000002722f699283 (Mono JIT Code) UnityEditor.GameObjectInspector:GetPreviewData (bool)
    20. 0x000002722f698d4b (Mono JIT Code) UnityEditor.GameObjectInspector:RenderStaticPreview (string,UnityEngine.Object[],int,int)
    Unity devs please elaborate. I'm in the middle of transferring a large project from 2020 to 2022 and now in doubts. How severe is it?
    2022.3.4f1
     
  15. AngelSheriff

    AngelSheriff

    Joined:
    Jun 30, 2023
    Posts:
    2
    Hi, following this tutorial https://learn.unity.com/tutorial/lesson-2-4-collision-decisions
    I saw the problem coming when changing from 2021 to 2022.3.4f1

    At the beginning I got some warning about the mesh of the assets, something about not being valid FBX, What I am thinking is that FBX changed to be stricter and then without validation of the mesh as required in 2022, could trigger the memory leak because another error related to this?

    Probably I am wrong, but I am seeing a lot of FBX warnings from old assets when loading them in 2022 but no problem in 2021 or 2020
     
    Arathorn_J likes this.
  16. DigiLena

    DigiLena

    Joined:
    May 1, 2023
    Posts:
    1
  17. Vaycks

    Vaycks

    Joined:
    Mar 1, 2020
    Posts:
    13
    I'm in the exacte same case, I need to use NavMeshSurface.UpdateNavMesh(NavMeshData) but if I do then I got thos warning... Did you find a solution about that ?
     
  18. DerDicke

    DerDicke

    Joined:
    Jun 30, 2015
    Posts:
    292
    Unity 2023.1.7f1. directly after calling
    GameObject curPrefab = PrefabUtility.LoadPrefabContents(prefabPath);
    PrefabUtility.SaveAsPrefabAsset(curPrefab, prefabPath);
    PrefabUtility.UnloadPrefabContents(curPrefab);

    one time.
     
  19. Kristina_B

    Kristina_B

    Joined:
    Mar 28, 2019
    Posts:
    13
    Getting the same error after upgrading to Unity 2022.3.7f1 from 2021. In our case, we just need to open Animator tab for a few prefabs, and on 4th or 5th prefab the error will show up. After that sometimes the editor won't even show Animator state machine and will start throwing "Null reference exception" errors.

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Graphs.Edge.WakeUp () (at <021ad9261da248d7a1251390c25c529f>:0)
    UnityEditor.Graphs.Graph.DoWakeUpEdges (System.Collections.Generic.List`1[T] inEdges, System.Collections.Generic.List`1[T] ok, System.Collections.Generic.List`1[T] error, System.Boolean inEdgesUsedToBeValid) (at <021ad9261da248d7a1251390c25c529f>:0)
    UnityEditor.Graphs.Graph.WakeUpEdges (System.Boolean clearSlotEdges) (at <021ad9261da248d7a1251390c25c529f>:0)
    UnityEditor.Graphs.Graph.WakeUp (System.Boolean force) (at <021ad9261da248d7a1251390c25c529f>:0)
    UnityEditor.Graphs.Graph.WakeUp () (at <021ad9261da248d7a1251390c25c529f>:0)
    UnityEditor.Graphs.Graph.OnEnable () (at <021ad9261da248d7a1251390c25c529f>:0)


    In addition, after getting this bug, using "build and run" and testing on the device some sprites don't show up. Closing Unity and re-building before the error results in a proper build without the issue with the missing sprites. So it seems this leak affects the builds too, not only the editor console.
    We can't roll back to Unity 2021 unfortunately, so hoping this will be fixed soon.
     
    Last edited: Sep 22, 2023
  20. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Guys --- Does this have a bug ticket raised as its happening in 2023.1.

    The code culprit its happening for me is this

    var modelRootGO = (GameObject)AssetDatabase.LoadMainAssetAtPath(assetPath);

    var instanceRoot = PrefabUtility.InstantiatePrefab(modelRootGO) as GameObject;

    Soon as the prefab variant is created and i click on it in the project window it comes up with

    upload_2023-9-29_17-53-33.png
     
  21. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    I just filed a bug report under
    CASE IN-56259
     
  22. DerDicke

    DerDicke

    Joined:
    Jun 30, 2015
    Posts:
    292
    I gave up on this years ago. Best you can hope for is "unable to reproduce".
     
  23. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Maybe if they spend more time on their engine solving real issues like this they might improve their monitization issues another way.
     
    Rodolfo-Rubens likes this.
  24. DerDicke

    DerDicke

    Joined:
    Jun 30, 2015
    Posts:
    292
    Yeah... I've no idea how management didn't see this coming. But we live in a time of degeneration. Everything gets worse.
     
  25. sonny_0922

    sonny_0922

    Joined:
    Sep 19, 2018
    Posts:
    1
    How do you change that? The pic isn't loading.

    The reply from above was deleted, anyhow, I got the bug as well
     
    Last edited: Oct 6, 2023
  26. Kristina_B

    Kristina_B

    Joined:
    Mar 28, 2019
    Posts:
    13
    Can you give a link to this ticket? Search there doesn't find it by the number.
     
  27. serkanos

    serkanos

    Joined:
    Jan 12, 2013
    Posts:
    28
    I have that same problem. It started to appear when we moved from 2019 to 2022.
     
  28. unity_JwWIdtAbuZYrfg

    unity_JwWIdtAbuZYrfg

    Joined:
    Apr 13, 2021
    Posts:
    1
    still occurs in 23.1.18f1
     
  29. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Can you please re-raise the issue ticket for this? Seems like the ticket i raised can't be traced.
     
  30. Exidus

    Exidus

    Joined:
    Mar 31, 2020
    Posts:
    1
    GXMark likes this.
  31. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    47
    Last edited: Jan 25, 2024
  32. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,453
    If you have a repro for this, please do raise a bug for this via the Editor menu
    Help > Report A Bug
    !

    There's a good chance that won't get fixed without one, and the only ticket mentioned in this thread has been closed as it did not contain enough info to reproduce it, so just posting to this thread and waiting will not help any of us in resolving the issue.
     
  33. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    47
    Done, IN-67428
    I think I accidentally send the bug report twice, another one is IN-67423
    It should contains the entire project. It's just a tutorial project I followed (Code Monkey's Kitchen Chaos single player tutorial) so doesn't contain any sensitive information.
    With all the assets it should be very easy to recreate this problem.
     
    Last edited: Jan 31, 2024
    MartinTilo likes this.
  34. Mrhiga

    Mrhiga

    Joined:
    Oct 24, 2018
    Posts:
    3
    i have the same problem unity ver 2022.3.6f1 LTS .i create a new project to test thing and a empty game object and as soon as i put it into prefab the warning show up the only thing that i did is to install navigation AI .did a terrain and bake it
     
  35. Mrhiga

    Mrhiga

    Joined:
    Oct 24, 2018
    Posts:
    3
    i will revert back to ver 2019 i had enoph bug already