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

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?

7 Likes

same issue… 2022.2.12

1 Like

Same here. My console is constantly getting flooded with these after updating from 2021 to 2022.

1 Like

I rolled back to 2021. Then scrapped entire project and started again because my code was an absolute mess. :frowning:

x2

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.

3 Likes

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.

Do we already have a solution for this?

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.

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

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))

2 Likes

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. :frowning:

Hm, in that case try going through the Unity Hub, reporting through there

I get this callstack after enabling validation:

[Worker0] Allocation of 32 bytes at e020c760 in block 0 (frameIndex=1, lifetime=4, age=2, state=OK)
0x00007ff72a26f9eb (Unity) PlayableGraph::smile:estroyPlayableDeferred
0x00007ff72a6f6821 (Unity) Animator::ClearInternalControllerPlayable
0x00007ff72a6f6a39 (Unity) Animator::ClearObject
0x00007ff72a6f7abf (Unity) Animator::smile:eactivate
0x00007ff729c25835 (Unity) GameObject::ActivateAwakeRecursivelyInternal
0x00007ff729c25674 (Unity) GameObject::ActivateAwakeRecursivelyInternal
0x00007ff729c253f9 (Unity) GameObject::ActivateAwakeRecursively
0x00007ff729c28629 (Unity) GameObject::smile:eactivate
0x00007ff729fdeb90 (Unity) UnityScene::OnGameObjectChangedScene
0x00007ff72a1f10fd (Unity) SceneManagerBindings::MoveGameObjectToScene
0x00007ff7293dfba1 (Unity) SceneManager_CUSTOM_MoveGameObjectToScene_Injected
0x000002722f69b4e5 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.SceneManagement.SceneManager:MoveGameObjectToScene_Injected (UnityEngine.GameObject,UnityEngine.SceneManagement.Scene&)
0x000002722f69b40b (Mono JIT Code) UnityEngine.SceneManagement.SceneManager:MoveGameObjectToScene (UnityEngine.GameObject,UnityEngine.SceneManagement.Scene)
0x00000274724ffe03 (Mono JIT Code) UnityEditor.PreviewScene:AddManagedGO (UnityEngine.GameObject)
0x000002722f69ffc3 (Mono JIT Code) UnityEditor.PreviewRenderUtility:AddManagedGO (UnityEngine.GameObject)
0x000002722f69d9c3 (Mono JIT Code) UnityEditor.GameObjectInspector/PreviewData:UpdateGameObject (UnityEngine.Object)
0x000002722f6999db (Mono JIT Code) UnityEditor.GameObjectInspector/PreviewData:.ctor (UnityEngine.Object,bool)
0x000002722f699283 (Mono JIT Code) UnityEditor.GameObjectInspector:GetPreviewData (bool)
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

Hi, following this tutorial Lesson 2.4 - Collision Decisions - Unity Learn
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

1 Like

Has there been updates on this error? I am getting it while following this tutorial: Sprite Animation - Unity Learn
version 2022.3.7

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 ?

Unity 2023.1.7f1. directly after calling
GameObject curPrefab = PrefabUtility.LoadPrefabContents(prefabPath);
PrefabUtility.SaveAsPrefabAsset(curPrefab, prefabPath);
PrefabUtility.UnloadPrefabContents(curPrefab);

one time.

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.

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.

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