Hi there,
we are repeatedly triggering renderings with the MovieRenderQueue from C++ with some scene modifications inbetween. We now upgraded from Unreal 4.27 to 5.2 and after a couple of hundred calls Unreal crashes, after filling up all the available RAM and the Pagefile (total of 300GB). When skipping the MovieRenderQueue call and just doing our scene modifications memory remains stable. And in 4.27 there was no problem as well. So it appears to have something to do wtih the MovieRenderQueue and Unreal 5.x.
Has anybody encountered anything like this before or any idea how to fix it or work aronud the problem?
Hi,
Unfortunately, we are not aware of issue in this kind of scenario.
Could you give us more information on how you are triggering this movie render queue tasks in C++?
Is there anything else, that has to be done? We have some other customizations too, for example, we added a custom output format, by deriving from MoviePipelineImageSequenceOutputBase.
We ran a couple of more tests in the meantime. We tried to start the MovieRenderQueue manually, and without our custom output format and observed the same increase in RAM usage, that did not go down afterwards, even when running the console command
gc.CollectGarbageEveryFrame 1
to trigger garbage collection. Also, the memory increase was most significant when using postprocess materials. And sometimes we had crashes even way before system memory was full.
If you still have trouble to reproduce our issues, I can also provide you with crash logs or setup a small test scene for you. Just let me know, what you need.
Yes, we were able to figure out that it was indeed a bug in the movie render queue, causing it to add RenderTargets to the gc roots and never removing them. The bug was in the engine from 5.0 to 5.2 and is fixed from 5.3 onwards.
However, if a bug leaking ~100mb ram per call goes unnoticed for 3 versions of the
engine, it should be clear that this use case has not a high development/testing priority for most of the engine developers and users. So be prepared to figure things out yourself, and be aware that your mileage may vary.