$begingroup$

A Native Collection has not been disposed, leading to a reminiscence leak. Enable Full StackTraces to get extra particulars.

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

How does one allow the kind of full stack hint this error requires to decipher the place issues went incorrect?

  • I attempted the complete stack checkboxes on the underside of Player Settings, however it nonetheless doesn’t reveal additional particulars.
  • I’ve tried to .Dispose() each upon starting a brand new recording and on saving. Calling .Dispose led to a different error InvalidOperationException: The NativeArray has been deallocated, it's not allowed to entry it
  • I additionally tried utilizing brackets [DeallocateOnJobCompletion] above the NativeArray variable declarations (nonetheless happens)

$endgroup$

3

$begingroup$

Unity 2020+, in it is infinite knowledge, eliminated the power so that you can simply discover the trigger for this message. They supplied a workaround, however as you will note following these steps, this can be very hacky:

  • Go Window -> Package Manager
  • Click the + icon on the topleft, choose add package deal from git URL
  • Enter com.unity.jobs (It’s not a git URL, however that is what Unity desires you to do)

You now have the Jobs tab on the high of your Editor.

  • Go Jobs -> Leak Detection -> Full Stack Traces (Expensive)
  • Close and open the editor once more, then rerun the sport

$endgroup$

You should log in to reply this query.

Not the reply you are on the lookout for? Browse different questions tagged .