The memory usage is very high when using video as input.
See original GitHub issueAs the title, when I use the camera as input, it will be fine. But when I use the video as input, the memory usage will be very high and cause the crash of the App. (Both synchronous and asynchronous will cause this problem) It even uses all the memory on my MacBook Pro, and the result will be the same if I build on iPhone7.
The error log will be like UnityGfxDeviceWorker (28): EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=1450 MB, unused=0x0)
in XCode.
And I also try to Enable/Disable the GameObject Solution
at runtime.
The memory usage will stop increasing when I disable the Solution
.(But the value of the memory usage won’t decrease)
I want to know if anyone has the same situation as me. I don’t have a clue why this happened.
thank you!
p.s. the video I used is only 4.5MB.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
Fixed by https://github.com/homuler/MediaPipeUnityPlugin/commit/cab8e26cb627f393f6dcbc3849b1675f39f56427
I found a solution! This is because the tmpRenderTexture buffer is not emptied from the ReadTextureFromOnCPU (Texture src) of the TextureFrame class.
If there’s any other problem, please let me know.