Is there some memory leak after media player closed in IOS platform?

Hi there, I have found some memory leak in my mobile game in IOS platform. It seems the CoreVideo textures used by media player are not released after media player closed.

Below is xcode frame capture:

Below is my UMG logic, the UI_Main2 is created and add to viewport in HUD.

Hey there @SimonLee! Is the widget with the texture itself being garbage collected? If so, the texture2D should unload shortly after there’s no other instances of it existing.

Thanks for your reply. Finally I got a way to release it. First, the UMG should avoid strong references to media assets(including media player, media texture, media source and so on), then do a force garbage collection.

1 Like

Ahhhh gotcha, great work! I was going to recommend in the worst case scenario to manually force collect it, as with textures they tend to be collected almost as soon as they are out of use, but with media players it’s a bit weird sometimes!

Yes, you are right. It’s not a good idea to force collect. Maybe you can give me a better advice later~

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.