Open Changliu52 opened 3 years ago
Unity doesnt garbage collect Texture2D
's properly, so if you're not re-using textures passed into GetNextFrameAndMeta()
, you need to manually destroy them with Texture2D.DestroyImmediate(texture, true);
when you're finished using them
here is where it only allocates new textures if you haven't passed some in https://github.com/NewChromantics/PopH264/blob/master/Unity/PopH264/Assets/PopH264/PopH264.cs#L247
Problem of not able to delete decoded images on windows still persist. All the received images stay in the memory. It takes about 10 mins to build up my entire 48 GB memory.
This is about 3 mins into the runtime.
Any suggestion to fix the bug?