Hi,
we identified a potential memory leak.
We use scene capture components for rendering of our scene but disable the rendering of the game viewport. The custom viewport sets UGameViewportClient::bDisableWorldRendering=true before calling UGameViewportClient::Draw and an actor with the USceneCaptureComponents manually triggers the capturing of the scene.
The problem with this setup is that the disabling of the world rendering also disables some cleanup routines. The function CleanupViewFamilies_RenderThread is never called which is problematic because ResetAndShrinkModifiedBounds inside the function is responsible for freeing up some memory. Without the call the DistanceFieldSceneData.PrimitiveModifiedBounds will never shrink leading to a relatively large memory leak (depending on the scene 500MB/h).
We managed to hackfix the memory leak by explicitly calling ResetAndShrinkModifiedBounds but it would be better to have some proper solution for this because the CleanupViewFamilies_RenderThread does more than just call the shrink function.
The question is, do you consider this to be a valid use case and is this something that you could fix or do we have to implement a fix ourselves?
I hope that this explanation is enough for you to reproduce the issue. I can provide you an example project if you really need it.
Best regards,
Ilja
[Attachment Removed]