Hi everyone, I’m creating a test project using UE5.4.4 which is simply repeatedly play a mp4 video using UMG. But there are several problems:
When using the looping functionality provided by the media player, the video will stutter OR completely freeze(but the engine is still running because I can still toggle the game console during the freeze) after several loops.
So I use the Memory Insights Tool to see if there can be any underlying problem and I noticed that there are patterns in the memory trace result:
The trace is running using the re-open workround(not the looping functionality provided by the media player).
The video lasts around 10 seconds.
The memory tag “LLM-Textures“ is continually grow every 10 seconds.
When using the “Memory Leak Query Tool“ there are results showing that “FRHIMemoryPool::Init” is leaking memory(might be leaking memory but I’m not very sure).
Follow these results I found that in RHIPoolAllocator.cpp(Line 317) there is a new operation which is allocating a FRHIPoolAllocationData pointer and the size of FRHIPoolAllocationData is 48 bytes.
Yeah, there have been some cases when looping stuff with Media Player results in memory leaks, due old data not being freed. From what I could find, further version of UE improved on this matter. Is it possible to test your project on 5.5 or 5.6?
If this is not an option, checking with my peers, you seem to be in the right track with the stop and restart method. Just make sure that GPU texture is being cleared by forcing garbage collector (either by code or blueprint), or flushed between loops, as that will build up on memory and eventually cause stutter or freeze.
Alternatevily, test by switching between DX11 and DX12, to see if the behaviour changes. And enable the following media parameters in Project Settings, they have proved useful in similar scenarios:
Hi @brs-sebascova, great to see you here again! I’ve upgraded the test project to UE5.6 and so far so good (using the looping functionality provided by the media player). Still planning to run the packaged builds for some days to get more reliable results.
In UE5.4 when using the re-open workround, the behaviors may differ: One of the video plays normally(no stutter or freeze for about 3 days) and another video will freeze after 1 or 2 days.
Hi @brs-sebascova, Switching to Bink Media Player seems to be a solution. I’ve tested that in UE5.4 using the looping functionality by Bink Media Player.