Memory Leak(s) still present in 4.3.81

I at still having memory leaks in 4.3.81 in 2022.3.7

Found 1 leak(s) from callstack:
0x000001d8ef35ee63 (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)
0x000001d8ef35ed03 (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)
0x000001d8ef35ea7b (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)
0x000001d8ef35e7bb (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)
0x000001d8ef35e71b (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)
0x000001d8ef35e343 (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)
0x000001d8ef35e1eb (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)
0x000001d8ef35e153 (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)
0x000001d8ef35dbc3 (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)
0x000001d8ef35da53 (Mono JIT Code) Pathfinding.Util.UnsafeSpan`1<Pathfinding.BinaryHeap/HeapNode>:.ctor (Unity.Collections.Allocator,int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.81/Core/Collections/Span.cs:59)
0x000001d8ef35d963 (Mono JIT Code) Pathfinding.BinaryHeap:.ctor (int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.81/Core/Collections/BinaryHeap.cs:90)
0x000001d8ef35d73b (Mono JIT Code) Pathfinding.PathHandler:.ctor (Pathfinding.GlobalNodeStorage,int,int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.81/Core/Pathfinding/PathHandler.cs:154)
0x000001d8ef35d51b (Mono JIT Code) Pathfinding.PathProcessor:SetThreadCount (int,bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.81/Core/Pathfinding/PathProcessor.cs:98)
0x000001d5bac5245b (Mono JIT Code) AstarPath:InitializePathProcessor () (at ./Library/PackageCache/com.arongranberg.astar@4.3.81/Core/AstarPath.cs:1187)
0x000001d59a5493b3 (Mono JIT Code) AstarPath:OnEnable () (at ./Library/PackageCache/com.arongranberg.astar@4.3.81/Core/AstarPath.cs:1317)
0x000001d8ef250e38 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffada79e0d4 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffada6deb74 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007ffada6ded0c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)

Hi

Can you replicate this in any example scene?

I am afraid yes. Below is the screenshot from example Door 1. Please don’t mind magenta materials, I am using HDRP & didn’t update the materials.

Hi

I cannot replicate this. How exactly are you tracking the leaks? Which options are enabled?

Nothing special

image

Unless you are asking about something else?

Very strange… I have the same options, yet I cannot replicate it :confused:
Can you replicate this in a fresh project too?

@aron_granberg
the version of com.unity.burst (1.8.3) and com.unity.collections (2.1.0-pre.11) are not the latest version in the Astar Pathfinding pro package. would you consider upgrading them?

I suggest that you directly send the unity package by email, which could replicate the issue, including the unity version and package.json you are using, and describe the steps of how to replicate this issue.

I don’t know where you get the collections’ version as I am using 2.1.4 which afaik is the latest available version for Unity 2022.2.7f1 at the time of writing.

I am using the latest version of packages and the leak messages are present in the console.

Hi @nehvaleem
I forgot to @aron_granberg, I meant that the Astar Pathfinding pro package is not using the latest version

I managed to replicate it! It required a different project configuration than what I’ve been using, so it didn’t happen for me in my tests.
I’ll include a fix in the next beta update.

1 Like

I don’t think that it is great news, but after upgrading to 4.3.82 I am getting 3 leaks (earlier there were 2 iirc).

I am not using the Enter Play Mode Options. It shows after enter/exit play mode.

1st:

Found 1 leak(s) from callstack:
0x000001e8a9b83e63 (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)
0x000001e8a9b83d03 (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)
0x000001e8a9b83a7b (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)
0x000001e8a9b837bb (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)
0x000001e8a9b8371b (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)
0x000001e8a9b83343 (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)
0x000001e8a9b831eb (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)
0x000001e8a9b83153 (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)
0x000001e8a9b82bc3 (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)
0x000001e8a9b82a53 (Mono JIT Code) Pathfinding.Util.UnsafeSpan`1<Pathfinding.BinaryHeap/HeapNode>:.ctor (Unity.Collections.Allocator,int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Collections/Span.cs:59)
0x000001e8a9b82963 (Mono JIT Code) Pathfinding.BinaryHeap:.ctor (int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Collections/BinaryHeap.cs:90)
0x000001e8a9b8273b (Mono JIT Code) Pathfinding.PathHandler:.ctor (Pathfinding.GlobalNodeStorage,int,int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Pathfinding/PathHandler.cs:154)
0x000001e8a9b8251b (Mono JIT Code) Pathfinding.PathProcessor:SetThreadCount (int,bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Pathfinding/PathProcessor.cs:98)
0x000001e8a9b81743 (Mono JIT Code) Pathfinding.PathProcessor:.ctor (AstarPath,Pathfinding.PathReturnQueue,int,bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Pathfinding/PathProcessor.cs:76)
0x000001e8a9b80373 (Mono JIT Code) AstarPath:.ctor () (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/AstarPath.cs:608)
0x000001eb61b46158 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ff8efa6e0d4 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ff8ef9aeb74 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007ff8ef9aed0c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)

2nd

Found 1 leak(s) from callstack:
0x000001e8a9b83e63 (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)
0x000001e8a9b83d03 (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)
0x000001e8a9b83a7b (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)
0x000001e8a9b837bb (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)
0x000001e8a9b8371b (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)
0x000001e8a9b83343 (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)
0x000001e8a9b831eb (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)
0x000001e8a9b84473 (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)
0x000001e8a9b843fb (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)
0x000001e8a9b84303 (Mono JIT Code) Pathfinding.Util.UnsafeSpan`1<Pathfinding.TemporaryNode>:.ctor (Unity.Collections.Allocator,int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Collections/Span.cs:59)
0x000001e8a9b82823 (Mono JIT Code) Pathfinding.PathHandler:.ctor (Pathfinding.GlobalNodeStorage,int,int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Pathfinding/PathHandler.cs:169)
0x000001e8a9b8251b (Mono JIT Code) Pathfinding.PathProcessor:SetThreadCount (int,bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Pathfinding/PathProcessor.cs:98)
0x000001e8a9b81743 (Mono JIT Code) Pathfinding.PathProcessor:.ctor (AstarPath,Pathfinding.PathReturnQueue,int,bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Pathfinding/PathProcessor.cs:76)
0x000001e8a9b80373 (Mono JIT Code) AstarPath:.ctor () (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/AstarPath.cs:608)
0x000001eb61b46158 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ff8efa6e0d4 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ff8ef9aeb74 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007ff8ef9aed0c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)
0x00007ff740350b30 (Unity) mono_runtime_object_init_exception

3rd:

Found 1 leak(s) from callstack:
0x000001e8a9b83e63 (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)
0x000001e8a9b83d03 (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)
0x000001e8a9b83a7b (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)
0x000001e8a9b837bb (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)
0x000001e8a9b8371b (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)
0x000001e8a9b83343 (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)
0x000001e8a9b831eb (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)
0x000001e8a9b84dc3 (Mono JIT Code) Unity.Collections.AllocatorManager:Allocate<Unity.Collections.AllocatorManager/AllocatorHandle, Pathfinding.PathNode> (Unity.Collections.AllocatorManager/AllocatorHandle&,Pathfinding.PathNode,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:58)
0x000001e8a9b84d4b (Mono JIT Code) Unity.Collections.AllocatorManager:Allocate<Pathfinding.PathNode> (Unity.Collections.AllocatorManager/AllocatorHandle,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:113)
0x000001e8a9b84c93 (Mono JIT Code) Pathfinding.Util.UnsafeSpan`1<Pathfinding.PathNode>:.ctor (Unity.Collections.Allocator,int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Collections/Span.cs:59)
0x000001e8a9b8477b (Mono JIT Code) Pathfinding.GlobalNodeStorage:SetThreadCount (int) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Pathfinding/GlobalNodeStorage.cs:128)
0x000001e8a9b8255b (Mono JIT Code) Pathfinding.PathProcessor:SetThreadCount (int,bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Pathfinding/PathProcessor.cs:101)
0x000001e8a9b81743 (Mono JIT Code) Pathfinding.PathProcessor:.ctor (AstarPath,Pathfinding.PathReturnQueue,int,bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/Pathfinding/PathProcessor.cs:76)
0x000001e8a9b80373 (Mono JIT Code) AstarPath:.ctor () (at ./Library/PackageCache/com.arongranberg.astar@4.3.82/Core/AstarPath.cs:608)
0x000001eb61b46158 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ff8efa6e0d4 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ff8ef9aeb74 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007ff8ef9aed0c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)
0x00007ff740350b30 (Unity) mono_runtime_object_init_exception

Hi

Really weird… I cannot replicate this at all.
Would it be possible for you to share a small sample project in which you can replicate these leaks?

it will be difficult as it happens in my main project (which is quite big). I’ll try to isolate the cause or make some repro but no promises there.

1 Like

@aron_granberg

Same messages.
A* 4.3.82
Unity 2022.3.11f1
Collections 2.1.4

Same 3 leaks here as mention above:
A* 4.3.82
Unity 2022.3.11f1
Collections 2.1.4

Could you try with 4.3.84?

Sure, oh btw. The whole Editor crashes a lot more now after updating to the Beta-version. But will create another forum-thread with that issue. Maybe the 4.3.84 version will solve that as well.

(Stopped crashing when i didn’t use the A* Package)

Oh poop, this might take some time, now i can’t even start the game, get a new error:

I’m reading the map with obstacles that have a RecastMeshObj, and when I’m finishing reading the map, i disable it (to be able to read all maps into data).
But upon disabling the map, these objects with RecastMeshObj cast an error:

IndexOutOfRangeException: Index was outside the bounds of the array.
Pathfinding.Graphs.Navmesh.AABBTree1[T].Remove (Pathfinding.Graphs.Navmesh.AABBTree1+Key[T] key) (at ./Library/PackageCache/com.arongranberg.astar@4.3.84/Graphs/Navmesh/AABBTree.cs:138)
Pathfinding.RecastMeshObj.OnDisable () (at ./Library/PackageCache/com.arongranberg.astar@4.3.84/Graphs/Utilities/RecastMeshObj.cs:199)

Downgraded the version to 4.3.83 and now it works again. 3 Leak detection still present though.