There is a race condition that sometimes occurs when a Scene is destroyed. Some of the jobs that were scheduled do not terminate before OnDestroy is called. This causes a scheduling conflict because some of those jobs are scheduled to use Allocator.Persistent containers stored in a Monobehaviour. When the Monobehaviour calls NativeHashMap.Dispose(), sometimes those jobs are still scheduled or running, outputting error messages on the console. Code (CSharp): InvalidOperationException: The previously scheduled job NativeLRUCacheSingle`2:SetJob writes to the NativeArray SetJob.data.cache. You must call JobHandle.Complete() on the job NativeLRUCacheSingle`2:SetJob, before you can deallocate the NativeArray safely. Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckDeallocateAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) <0x159b914b0 + 0x00052> in <3b14123eec6449dcbdce6fe247c0f416>:0 Unity.Collections.LowLevel.Unsafe.DisposeSentinel.Dispose (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle& safety, Unity.Collections.LowLevel.Unsafe.DisposeSentinel& sentinel) (at /Users/builduser/buildslave/unity/build/Runtime/Export/NativeArray/DisposeSentinel.cs:69) Unity.Collections.NativeHashMap`2[TKey,TValue].Dispose () (at Library/PackageCacheemail@example.com/Unity.Collections/NativeHashMap.cs:685) NativeLRUCacheSingle`2[K,V].Dispose () (at Assets/Scripts/Utility/NativeContainer/NativeLRUCacheSingle.cs:125) ResultCacheSingle`2[Request,Result].OnDestroy () (at Assets/Scripts/Environment/Physics/CalculatorIO/ResultCacheSingle.cs:33) Some potentially helpful information: The JobHandle that acts on those persistent containers is passed to EntityCommandBufferSystem.AddJobHandleForProducer(inputDeps). I sorta abuse EntityCommandBufferSystem to force jobs to complete at a certain time. A Monobehaviour usually titled [name of EntityCommandBufferSystem]Runner fetches the EntityCommandBufferSystem and manually runs it in FixedUpdate() The strange thing is that whenever this error occurs, the next time I run the application, three NativeContainer leak errors appear. Those three NativeContainers are the ones that would've been disposed of had they been disposed of in the previous application run! If needed I can include a link to the project.