RVO Controller - Memory Leak v4.3.76

Hello!

Was wondering if there was any fix regarding this memory leak upon playing in Editor? I am using Unity 2022.3.0 with Astar v4.3.76. Stack trace is below.

Found 1 leak(s) from callstack:
0x000001c9cea41c83 (Mono JIT Code) Unity.Collections.NativeArray1<Pathfinding.ECS.RVO.AgentIndex>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray1<Pathfinding.ECS.RVO.AgentIndex>&)
0x000001c9cea418a3 (Mono JIT Code) Unity.Collections.NativeArray1<Pathfinding.ECS.RVO.AgentIndex>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions) 0x000001c9cea412b3 (Mono JIT Code) Pathfinding.Util.Memory:Realloc<Pathfinding.ECS.RVO.AgentIndex> (Unity.Collections.NativeArray1<Pathfinding.ECS.RVO.AgentIndex>&,int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions) (at ./Library/PackageCache/com.arongranberg.astar@4.3.76/Core/Collections/AstarMemory.cs:116)
0x000001c9cea408c3 (Mono JIT Code) Pathfinding.RVO.SimulatorBurst/AgentData:Realloc (int,Unity.Collections.Allocator) (at ./Library/PackageCache/com.arongranberg.astar@4.3.76/Core/RVO/RVOCoreSimulatorBurst.cs:608)
0x000001c9cea40233 (Mono JIT Code) Pathfinding.RVO.SimulatorBurst:AllocateAgentSpace () (at ./Library/PackageCache/com.arongranberg.astar@4.3.76/Core/RVO/RVOCoreSimulatorBurst.cs:878)
0x000001c9cea3fab3 (Mono JIT Code) Pathfinding.RVO.SimulatorBurst:.ctor (Pathfinding.RVO.MovementPlane) (at ./Library/PackageCache/com.arongranberg.astar@4.3.76/Core/RVO/RVOCoreSimulatorBurst.cs:847)
0x000001c9cea3f6d3 (Mono JIT Code) Pathfinding.RVO.RVOSimulator:GetSimulator () (at ./Library/PackageCache/com.arongranberg.astar@4.3.76/RVO/RVOSimulator.cs:112)
0x000001c9cea3ecd3 (Mono JIT Code) Pathfinding.RVO.RVOController:OnEnable () (at ./Library/PackageCache/com.arongranberg.astar@4.3.76/RVO/RVOController.cs:416)
0x000001c9dec5a468 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ff871b2e084 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ff871a6eb84 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007ff871a6ed1c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)
0x00007ff6211cc4c4 (Unity) scripting_method_invoke
0x00007ff6211ab144 (Unity) ScriptingInvocation::Invoke
0x00007ff621192764 (Unity) MonoBehaviour::CallMethodIfAvailable
0x00007ff621190d16 (Unity) MonoBehaviour::AddToManager
0x00007ff6211917da (Unity) MonoBehaviour::AwakeFromLoad
0x00007ff621289b8f (Unity) AwakeFromLoadQueue::InvokePersistentManagerAwake
0x00007ff62128a88c (Unity) AwakeFromLoadQueue::PersistentManagerAwakeFromLoad

I also encountered this, waiting for a fix

Hi

Do you have a way to reproduce this error?

Currently, the only way I can reproduce it is by going into play mode. I should also mention that I did just upgrade my Unity version from 2021 LTS to 2022 LTS.

Same problem here with 4.3.77. This happens in Example16_RVO_2D or 11. Seems that i need to play 2 times the scene, at the second run i’ve the :
Found 1 leak(s) from callstack:
0x0000017829eedc1b (Mono JIT Code) Unity.Collections.NativeArray1<Pathfinding.ECS.RVO.AgentIndex>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray1<Pathfinding.ECS.RVO.AgentIndex>&)
0x0000017829eedb03 (Mono JIT Code) Unity.Collections.NativeArray1<Pathfinding.ECS.RVO.AgentIndex>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions) 0x0000017829eed83b (Mono JIT Code) Pathfinding.Util.Memory:Realloc<Pathfinding.ECS.RVO.AgentIndex> (Unity.Collections.NativeArray1<Pathfinding.ECS.RVO.AgentIndex>&,int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions) (at ./Library/PackageCache/com.arongranberg.astar@4.3.77/Core/Collections/AstarMemory.cs:116)
0x0000017829eed313 (Mono JIT Code) Pathfinding.RVO.SimulatorBurst/AgentData:Realloc (int,Unity.Collections.Allocator) (at ./Library/PackageCache/com.arongranberg.astar@4.3.77/Core/RVO/RVOCoreSimulatorBurst.cs:609)
0x0000017829eeceeb (Mono JIT Code) Pathfinding.RVO.SimulatorBurst:AllocateAgentSpace () (at ./Library/PackageCache/com.arongranberg.astar@4.3.77/Core/RVO/RVOCoreSimulatorBurst.cs:878)
0x000001782a1600b3 (Mono JIT Code) Pathfinding.RVO.SimulatorBurst:AddAgentBurst (Unity.Mathematics.float3) (at ./Library/PackageCache/com.arongranberg.astar@4.3.77/Core/RVO/RVOCoreSimulatorBurst.cs:933)
0x000001782a15f8e3 (Mono JIT Code) Pathfinding.RVO.SimulatorBurst:AddAgent (UnityEngine.Vector3) (at ./Library/PackageCache/com.arongranberg.astar@4.3.77/Core/RVO/RVOCoreSimulatorBurst.cs:911)
0x000001782a15f61b (Mono JIT Code) Pathfinding.RVO.RVOController:OnEnable () (at ./Library/PackageCache/com.arongranberg.astar@4.3.77/RVO/RVOController.cs:417)
0x000001782a04d368 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007fffb56de0d4 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007fffb561eb74 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007fffb561ed0c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)
0x00007ff67e566f54 (Unity) scripting_method_invoke
0x00007ff67e545bd4 (Unity) ScriptingInvocation::Invoke
0x00007ff67e52cdd4 (Unity) MonoBehaviour::CallMethodIfAvailable
0x00007ff67e52b386 (Unity) MonoBehaviour::AddToManager
0x00007ff67e52be4a (Unity) MonoBehaviour::AwakeFromLoad
0x00007ff67e623527 (Unity) AwakeFromLoadQueue::InvokeAwakeFromLoad
0x00007ff67e61e486 (Unity) AwakeFromLoadQueue::AwakeFromLoadAllQueues

Thanks! I’ll fix this in the next beta update.