# A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details

A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details.

In working on saving to file the NativeArrays used to fetch BlendShapeCoefficients in ARFoundation, I encountered the error above.

How does one enable the type of full stack trace this error requires to decipher where things went wrong?

• I tried the full stack checkboxes on the bottom of Player Settings, but it still does not reveal further details.
• I have tried to .Dispose() both upon beginning a new recording and on saving. Calling .Dispose led to another error InvalidOperationException: The NativeArray has been deallocated, it is not allowed to access it
• I also tried using brackets [DeallocateOnJobCompletion] above the NativeArray variable declarations (still occurs)
• If you'd like help debugging the code that causes this error, I'd recommend editing your question to include a Minimal Complete Verifiable Example of that code. – DMGregory Oct 2 '20 at 8:48
• As for enabling the full stack trace: I'm doing this out of my head, so I might be partially wrong, also this is based on how it worked in Unity 2019, in 2020 some might have moved to project settings by now, not sure. That setting should be under the top bar menu of 'jobs' (Next to File, Edit, Assets, that menu). However, this 'jobs' menu item (or the 'enable full stack trace' sub menu item) doesn't exist without the correct packages. I believe I had to get the 'jobs' package for it to exist, but might even need the 'Entities' package, not sure... – troien Oct 2 '20 at 9:23
• i wish this were better documented @troien – ina Oct 2 '20 at 20:38

• @Xwtek - What version of Unity are you using? I posted this on February 23rd, and probably would have been using 2020.1 at the time; I'm using 2021.1 now and it's exactly the same. Also, please verify that you have the Jobs package installed: you have to go to "Window" then "Package Manager" then click the + in the upper-left of the package manager and use "Use Package By Name" then enter the name of the Jobs package com.unity.jobs – Chuck Jun 4 at 3:03