Hello,
We’re trying to reclaim some of the memory used by nonstreaming mips, which seems incongruously high. We suspect the mp4 videos used in the background of the main menu might be a big factor. To verify this, we made two builds (the first with main menu videos, the second without) and compared their memory usage. As you can see in the graphs below, the build without videos is nearly 900 MiB lighter:
[Image Removed]
This is fine while the player is in the main menu, but the real problem is that we’re continuing to pay for those movies during gameplay. On the graphs, the black line marked with an asterisk indicates the point where the movies are no longer referenced by anything in the game. Any memory used by the movies after that line is pure wasted space.
An initial investigation turned up some dependency chains linking the main menu to gameplay objects, which we removed. However, this gave no significant reduction in memory use, even after forcing garbage collection. To be absolutely sure that we hadn’t missed some stray reference, we ran obj refs name=[video name] on the video objects from within the main menu and during gameplay. It correctly reported the object in the main menu, and reported that the object did not exist during gameplay.
We also investigated the theory that perhaps the media texture was not properly getting cleared. Our media texture is by default set auto clear true. While the main menu is active, auto clear is set false so that the video loops cleanly without black frames. Upon leaving the main menu, we restore auto clear to true and call UMediaPlayer->Close(). Breakpoints show that Close() is always called correctly, and that auto clear is always true when Close() is called.
Do you have any insight into why the videos would continue to incur such a high memory cost even after they’re (to our best knowledge) no longer referenced by living game objects? Is it necessary to delete the media player object entirely between uses, rather than just clearing the playlist and calling Close()?
Any help would be greatly appreciated. I’ve attached a zip with the outputs of obj list from within the main menu and from within gameplay. Please let me know if there’s more information I can provide to help diagnose the issue.
Thank you,
April Martin
[Attachment Removed]