Search Issue Tracker
Duplicate
Votes
0
Found in [Package]
4.1.12
4.2.2
4.2.3
4.2.6
5.0.3
Issue ID
ARFB-179
Regression
No
ARFoundation.ARPlane memory leak of boundary NativeArray when using Holographic Remoting to HoloLens 2
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)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- VFX Graph effect instance stops rendering when a second instance of the same effect starts 2 frames later
- Operations on the Color32 array are not reflected in WebGL Player when HDR is off
- Rigidbody moves away from the original GameObject when Center of Mass is set in every frame
- WebGL Player does not proceed beyond logo screen when "Target WebAssembly 2023" is enabled
- "NullReferenceException" error thrown in UnityEditor.ObjectListArea when an audio clip is selected in one of two opened Project tabs while the second Project tab is not active/painted
Resolution Note:
This issue has been fixed for a while, this is a duplicate issue.
Duplicate of another internal issue: ARFB-177: ARPlane NativeArray memory leak when running in 2021 editor