Hi, I noticed that when I use barracuda worker with WorkerFactory.Type.CSharpBurst or WorkerFactory.Type.CSharp, calling Dispose() does not clean the memory correctly. Code (CSharp): var worker = WorkerFactory.CreateWorker(WorkerFactory.Type.CSharp, model); var inputTensor = new Tensor(texture, channelCount); // [1, 320, 256, 3] worker.Execute(inputTensor); var output = worker.PeekOutput(); ... inputTensor.Dispose(); output.Dispose(); worker.Dispose(); Could you please advice? Thank you
Could you clarify a bit what you mean by `does not clean the memory correctly`? Did you notice memory leaks or high memory usage?
Hello Alexandre, Correct! I noticed a memory leak. I have created an application that takes a photo, creates a Texture2D and the Tensor layer then passes it to the model to be classified. After getting the output I run dispose() as you can see, also I DestroyImmediate the Texture2D and I do System.GC.Collect(). I added this: System.GC.GetTotalMemory(false) before and after the function and with each time the memory keeps going up and never clearen. After 5 times repeating the same process I get OutOfMemory error. Looking forward to hearing from you soon.