Not signed in
Copyright © 2026 Unity Technologies
How to reproduce:
1. Open the attached project "Sample.zip"
2. Open Assets/ARRaycast/ARRaycast.unity
3. Enable Holographic Remoting for Play Mode (Mixed Reality>Remoting>Holographic Remoting for Play Mode)
4. Open Holographic Remoting on HoloLens 2
5. Enter Play Mode in the Editor
6. Open "AR Raycasting" Scene on HoloLens 2
7. Exit Play Mode
Expected results: No errors thrown in the Console window
Actual results: "A Native Collection has not been disposed, resulting in a memory leak." error thrown in the Console window
Reproducible with: 2020.3.33f1, 2021.3.3f1, 2022.1.1f1, 2022.2.0a11
Not reproducible with: 2022.2.0a12, 2022.2.0a13
Could not test with: 2019.4.38f1 (OpenXR not supported)
Reproducible on: Windows 10
Additional information shared from our Partner at Microsoft via a shared Favro board:
This crash only happens in the Unity 2020 / 2021 / 2022 Editors. The 2020 / 2021 / 2022 standalone or UWP builds outside the editor work fine as well.
Slightly newer version of this error, 2022:
A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Unity.Collections.NativeArray`1:.ctor(Int32, Allocator, NativeArrayOptions)
UnityEngine.XR.ARFoundation.ARPlane:UpdateBoundary(XRPlaneSubsystem) (at Library\PackageCache\com.unity.xr.arfoundation@4.2.3\Runtime\AR\ARPlane.cs:133)
UnityEngine.XR.ARFoundation.ARPlaneManager:OnAfterSetSessionRelativeData(ARPlane, BoundedPlane) (at Library\PackageCache\com.unity.xr.arfoundation@4.2.3\Runtime\AR\ARPlaneManager.cs:251)
UnityEngine.XR.ARFoundation.ARTrackableManager`5:CreateOrUpdateTrackable(BoundedPlane) (at Library\PackageCache\com.unity.xr.arfoundation@4.2.3\Runtime\AR\ARTrackableManager.cs:434)
UnityEngine.XR.ARFoundation.ARTrackableManager`5:Update() (at Library\PackageCache\com.unity.xr.arfoundation@4.2.3\Runtime\AR\ARTrackableManager.cs:186)
Old version of this error, 2020 / 2021:
A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Unity.Collections.NativeArray`1:.ctor(Int32, Allocator, NativeArrayOptions)
UnityEngine.XR.ARFoundation.ARPlane:UpdateBoundary(XRPlaneSubsystem) (at Library\PackageCache\com.unity.xr.arfoundation@4.2.2\Runtime\AR\ARPlane.cs:133)
UnityEngine.XR.ARFoundation.ARPlaneManager:OnAfterSetSessionRelativeData(ARPlane, BoundedPlane) (at Library\PackageCache\com.unity.xr.arfoundation@4.2.2\Runtime\AR\ARPlaneManager.cs:251)
UnityEngine.XR.ARFoundation.ARTrackableManager`5:CreateOrUpdateTrackable(BoundedPlane) (at Library\PackageCache\com.unity.xr.arfoundation@4.2.2\Runtime\AR\ARTrackableManager.cs:434)
UnityEngine.XR.ARFoundation.ARTrackableManager`5:Update() (at Library\PackageCache\com.unity.xr.arfoundation@4.2.2\Runtime\AR\ARTrackableManager.cs:177)
Sign in to see your voted issues