Search Issue Tracker

Won't Fix

Votes

0

Found in [Package]

1.4.0 - Collections

Issue ID

ECSB-401

Regression

No

NativeList with WriteOnly Attribute causes a memory leak when exiting Play Mode

Package: Unity Native Collections

-

How to reproduce:
1. Open the “MeshBreaker“ project
2. Open the “SampleScene”
3. Enter Play mode then exit Play mode and observe the Console

Expected result: “System::InvalidOperationException” and “ObjectDisposedException” errors are thrown
Actual result: “System::InvalidOperationException”, “ObjectDisposedException”, “A Native Collection has not been disposed, resulting in a memory leak” error is thrown

Reproduced with: 0.17.0-preview.18 (2022.3.1f1), 1.4.0 (2021.3.27f1, 2022.3.1f1, 2023.1.0b20, 2023.2.0a18)
Not reproduced with: 2.1.4 (2022.3.1f1, 2023.1.0b20, 2023.2.0a18)
Could not test with: 0.17.0-preview.18 (2021.3.27f1, 2023.1.0b20, 2023.2.0a18), 2.1.0-exp.4, 2.1.4 (2021.3.27f1) (Package not supported)
Fixed in: 2.1.0-exp.4 (2022.3.1f1, 2023.1.0b20, 2023.2.0a18)

Reproduced on: Windows 10 (by reporter), Windows 11

Error thrown to the Console:

{noformat}A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details. Leak tracking may be enabled via `Unity.Collections.NativeLeakDetection.Mode` or from the editor preferences menu Edit > Preferences > Jobs > Leak Detection Level.{noformat}

Note: “System::InvalidOperationException” and “ObjectDisposedException” errors are expected since a Burst Job is trying to access a ReadOnly NativeList

  1. Resolution Note:

    There are no fixes planned for this Bug

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.