JobTempAlloc issue with ScanAsync method

  • A* version: 5.4.4 Pro
  • Unity version: 6000.2.6f2

Hi, I am having an issue, where calling the “ScanAsnyc” method will log warnings to the console. The graph itself is perfectly fine, and the functionality is given - as far as I can tell. I am calling the function the same way as the documentation does.

Logs:
Internal: JobTempAlloc has allocations that are more than the maximum lifespan of 4 frames old - this is not allowed and likely a leak
To Debug, run app with -diag-job-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations.

Thanks. I haven’t seen this personally. Would it be possible for you to get the callstacks that the message is referencing? That would help a lot in tracking it down. :slight_smile:

Yeah, of course!

Here are the callstacks I’m getting:

Allocation of 4 bytes at f85fd0e0 in block 1 (frameIndex=10, lifetime=4, age=4, state=OK)
0x00007ff84b82c9b8 (Unity) UnsafeUtility_CUSTOM_MallocTracked
0x000001c6bfcffd3d (Mono JIT Code) (wrapper managed-to-native) Unity.Collections.LowLevel.Unsafe.UnsafeUtility:MallocTracked (long,int,Unity.Collections.Allocator,int)
0x000001c893a4f59b (Mono JIT Code) Unity.Collections.NativeArray1<UnityEngine.Rendering.InstanceHandle>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray1<UnityEngine.Rendering.InstanceHandle>&)
0x000001c893a4f483 (Mono JIT Code) Unity.Collections.NativeArray1<UnityEngine.Rendering.InstanceHandle>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions) 0x000001c89800cc13 (Mono JIT Code) UnityEngine.Rendering.GPUResidentDrawer:ProcessRendererMaterialAndMeshChanges (Unity.Collections.NativeArray1,Unity.Collections.NativeArray1<int>,Unity.Collections.NativeArray1<UnityEngine.Rendering.GPUDrivenPackedMaterialData>,Unity.Collections.NativeArray`1) (at ./Library/PackageCache/com.unity.render-pipelines.core@317e801bb3aa/Runtime/GPUDriven/GPUResidentDrawer.cs:728)
0x000001c897ffb973 (Mono JIT Code) UnityEngine.Rendering.GPUResidentDrawer:PostPostLateUpdate () (at ./Library/PackageCache/com.unity.render-pipelines.core@317e801bb3aa/Runtime/GPUDriven/GPUResidentDrawer.cs:612)
0x000001c897ffa64b (Mono JIT Code) UnityEngine.Rendering.GPUResidentDrawer:PostPostLateUpdateStatic () (at ./Library/PackageCache/com.unity.render-pipelines.core@317e801bb3aa/Runtime/GPUDriven/GPUResidentDrawer.cs:475)
0x000001c898118528 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ff8c5e86e7e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ff8c5dc8874 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)
0x00007ff8c5dc8960 (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3115)
0x00007ff84c5cfcc4 (Unity) scripting_method_invoke
0x00007ff84c5a8263 (Unity) ScriptingInvocation::Invoke
0x00007ff84c2350a4 (Unity) ExecutePlayerLoop
0x00007ff84c2350c5 (Unity) ExecutePlayerLoop
0x00007ff84c23b57f (Unity) PlayerLoop
0x00007ff84d34b3ea (Unity) EditorPlayerLoop::Execute
0x00007ff84d36208f (Unity) PlayerLoopController::InternalUpdateScene
0x00007ff84d363e5f (Unity) PlayerLoopController::UpdateSceneIfNeededFromMainLoop

-

70 00 00 00 .. .. .. .. .. .. .. .. .. .. .. .. p…

-

Allocation of 4 bytes at f85fd1b0 in block 1 (frameIndex=10, lifetime=4, age=4, state=OK)
0x00007ff84b82c9b8 (Unity) UnsafeUtility_CUSTOM_MallocTracked
0x000001c6bfcffd3d (Mono JIT Code) (wrapper managed-to-native) Unity.Collections.LowLevel.Unsafe.UnsafeUtility:MallocTracked (long,int,Unity.Collections.Allocator,int)
0x000001c7942b19fb (Mono JIT Code) Unity.Collections.NativeArray1<int>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray1&)
0x000001c7942b18e3 (Mono JIT Code) Unity.Collections.NativeArray1<int>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions) 0x000001c89800cc3b (Mono JIT Code) UnityEngine.Rendering.GPUResidentDrawer:ProcessRendererMaterialAndMeshChanges (Unity.Collections.NativeArray1,Unity.Collections.NativeArray1<int>,Unity.Collections.NativeArray1<UnityEngine.Rendering.GPUDrivenPackedMaterialData>,Unity.Collections.NativeArray`1) (at ./Library/PackageCache/com.unity.render-pipelines.core@317e801bb3aa/Runtime/GPUDriven/GPUResidentDrawer.cs:730)
0x000001c897ffb973 (Mono JIT Code) UnityEngine.Rendering.GPUResidentDrawer:PostPostLateUpdate () (at ./Library/PackageCache/com.unity.render-pipelines.core@317e801bb3aa/Runtime/GPUDriven/GPUResidentDrawer.cs:612)
0x000001c897ffa64b (Mono JIT Code) UnityEngine.Rendering.GPUResidentDrawer:PostPostLateUpdateStatic () (at ./Library/PackageCache/com.unity.render-pipelines.core@317e801bb3aa/Runtime/GPUDriven/GPUResidentDrawer.cs:475)
0x000001c898118528 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ff8c5e86e7e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ff8c5dc8874 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)
0x00007ff8c5dc8960 (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3115)
0x00007ff84c5cfcc4 (Unity) scripting_method_invoke
0x00007ff84c5a8263 (Unity) ScriptingInvocation::Invoke
0x00007ff84c2350a4 (Unity) ExecutePlayerLoop
0x00007ff84c2350c5 (Unity) ExecutePlayerLoop
0x00007ff84c23b57f (Unity) PlayerLoop
0x00007ff84d34b3ea (Unity) EditorPlayerLoop::Execute
0x00007ff84d36208f (Unity) PlayerLoopController::InternalUpdateScene
0x00007ff84d363e5f (Unity) PlayerLoopController::UpdateSceneIfNeededFromMainLoop

-

98 53 01 00 .. .. .. .. .. .. .. .. .. .. .. .. .S..

Let me know, if you need anything else :slight_smile:

Hi

Going by the call stacks, this doesn’t look related to the A* package at all.

Yeah, as I’ve read through it, I was wondering the same. It looks like the GPU resident drawer has something to do with it. Do you think it could be caused by A* reading the meshes while the resident drawer is active, or something like that? I’ll test some things and let you know :slight_smile:

I don’t think so. It doesn’t hold on to mesh data for more than a fraction of a frame in any case. But it’s hard to say for sure.