I recently updated my Astar Pathfinder to the most recent version, 4.3.79. Unity version I’m using is 2022.3.5f1.
Ever since the update, I’ve been getting some worrisome messages when I compile my scripts:
Leak Detected : Persistent allocates 2 individual allocations.
And when I enable leak detection level to Enabled With Stack Trace as instructed on the editor:
Found 1 leak(s) from callstack:
0x000001eaf4b7c343 (Mono JIT Code) Unity.Collections.Memory/Unmanaged/Array:Resize (void*,long,long,Unity.Collections.AllocatorManager/AllocatorHandle,long,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/Memory.cs:79)
0x000001eaf4b7c1e3 (Mono JIT Code) Unity.Collections.Memory/Unmanaged:Allocate (long,int,Unity.Collections.AllocatorManager/AllocatorHandle) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/Memory.cs:20)
0x000001eb9f3a735b (Mono JIT Code) Unity.Collections.AllocatorManager:TryLegacy (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:1023)
0x000001eb9f3a709b (Mono JIT Code) Unity.Collections.AllocatorManager:Try (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:1055)
0x000001eb9f3a6ffb (Mono JIT Code) Unity.Collections.AllocatorManager/AllocatorHandle:Try (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:540)
0x000001eb9f3a6c23 (Mono JIT Code) Unity.Collections.AllocatorManager:AllocateBlock<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int,int,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:32)
0x000001eb9f3a6acb (Mono JIT Code) Unity.Collections.AllocatorManager:Allocate<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int,int,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:53)
0x000001eb9f3a6a33 (Mono JIT Code) Unity.Collections.AllocatorManager:Allocate<Unity.Collections.AllocatorManager/AllocatorHandle, Pathfinding.BinaryHeap/HeapNode> (Unity.Collections.AllocatorManager/AllocatorHandle&,Pathfinding.BinaryHeap/HeapNode,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:58)
0x000001eb9f3a69b3 (Mono JIT Code) Unity.Collections.AllocatorManager:Allocate<Pathfinding.BinaryHeap/HeapNode> (Unity.Collections.AllocatorManager/AllocatorHandle,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:113)
0x000001eb9f3a68e3 (Mono JIT Code) Pathfinding.Util.UnsafeSpan`1<Pathfinding.BinaryHeap/HeapNode>:.ctor (Unity.Collections.Allocator,int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.79/Core/Collections/Span.cs:59)
0x000001eb9f3a67f3 (Mono JIT Code) Pathfinding.BinaryHeap:.ctor (int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.79/Core/Collections/BinaryHeap.cs:90)
0x000001eb9f3a65cb (Mono JIT Code) Pathfinding.PathHandler:.ctor (Pathfinding.GlobalNodeStorage,int,int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.79/Core/Pathfinding/PathHandler.cs:151)
0x000001eb9f3a63ab (Mono JIT Code) Pathfinding.PathProcessor:SetThreadCount (int,bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.79/Core/Pathfinding/PathProcessor.cs:98)
0x000001eb9f3c9dab (Mono JIT Code) AstarPath:InitializePathProcessor () (at ./Library/PackageCache/com.arongranberg.astar@4.3.79/Core/AstarPath.cs:1268)
0x000001eb9f3ae7d3 (Mono JIT Code) AstarPath:OnEnable () (at ./Library/PackageCache/com.arongranberg.astar@4.3.79/Core/AstarPath.cs:1398)
0x000001ebd0192108 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffa03dce0d4 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffa03d0eb74 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007ffa03d0ed0c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)
Found 1 leak(s) from callstack:
0x000001eaf4b7c343 (Mono JIT Code) Unity.Collections.Memory/Unmanaged/Array:Resize (void*,long,long,Unity.Collections.AllocatorManager/AllocatorHandle,long,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/Memory.cs:79)
0x000001eaf4b7c1e3 (Mono JIT Code) Unity.Collections.Memory/Unmanaged:Allocate (long,int,Unity.Collections.AllocatorManager/AllocatorHandle) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/Memory.cs:20)
0x000001eb9f3a735b (Mono JIT Code) Unity.Collections.AllocatorManager:TryLegacy (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:1023)
0x000001eb9f3a709b (Mono JIT Code) Unity.Collections.AllocatorManager:Try (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:1055)
0x000001eb9f3a6ffb (Mono JIT Code) Unity.Collections.AllocatorManager/AllocatorHandle:Try (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:540)
0x000001eb9f3a6c23 (Mono JIT Code) Unity.Collections.AllocatorManager:AllocateBlock<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int,int,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:32)
0x000001eb9f3a6acb (Mono JIT Code) Unity.Collections.AllocatorManager:Allocate<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int,int,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:53)
0x000001eb9f3a7733 (Mono JIT Code) Unity.Collections.AllocatorManager:Allocate<Unity.Collections.AllocatorManager/AllocatorHandle, Pathfinding.TemporaryNode> (Unity.Collections.AllocatorManager/AllocatorHandle&,Pathfinding.TemporaryNode,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:58)
0x000001eb9f3a76bb (Mono JIT Code) Unity.Collections.AllocatorManager:Allocate<Pathfinding.TemporaryNode> (Unity.Collections.AllocatorManager/AllocatorHandle,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:113)
0x000001eb9f3a75c3 (Mono JIT Code) Pathfinding.Util.UnsafeSpan`1<Pathfinding.TemporaryNode>:.ctor (Unity.Collections.Allocator,int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.79/Core/Collections/Span.cs:59)
0x000001eb9f3a66b3 (Mono JIT Code) Pathfinding.PathHandler:.ctor (Pathfinding.GlobalNodeStorage,int,int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.79/Core/Pathfinding/PathHandler.cs:169)
0x000001eb9f3a63ab (Mono JIT Code) Pathfinding.PathProcessor:SetThreadCount (int,bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.79/Core/Pathfinding/PathProcessor.cs:98)
0x000001eb9f3c9dab (Mono JIT Code) AstarPath:InitializePathProcessor () (at ./Library/PackageCache/com.arongranberg.astar@4.3.79/Core/AstarPath.cs:1268)
0x000001eb9f3ae7d3 (Mono JIT Code) AstarPath:OnEnable () (at ./Library/PackageCache/com.arongranberg.astar@4.3.79/Core/AstarPath.cs:1398)
0x000001ebd0192108 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffa03dce0d4 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffa03d0eb74 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007ffa03d0ed0c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)
0x00007ff7408d7bc4 (Unity) scripting_method_invoke
This only happens when I compile the script while a scene with a Astar Pathfinder component is open. When I compile the script while the scene does not contain any Astar Pathfinder component, this error message does not appear. So, although I assume this error message could be some sort of hiccup while compiling the script, I was not sure whether it would be safe or not to ignore this messages. Especially when I didn’t get any warning message of this kind back when I was using the old version.
Any advice would be greatly appreciated. Thanks,