# Memory leak when rendering scene captures without the game viewport 

**URL:** <https://forums.unrealengine.com/t/memory-leak-when-rendering-scene-captures-without-the-game-viewport/2858980>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [October 19, 2026, 10:53am UTC](https://forums.unrealengine.com/t/memory-leak-when-rendering-scene-captures-without-the-game-viewport/2858980 "2026-10-19T10:53:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 19, 2026, 10:53am UTC](https://forums.unrealengine.com/t/memory-leak-when-rendering-scene-captures-without-the-game-viewport/2858980/1 "2026-10-19T10:53:20Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 19, 2026, 10:53am UTC](https://forums.unrealengine.com/t/memory-leak-when-rendering-scene-captures-without-the-game-viewport/2858980/2 "2026-10-19T10:53:24Z")

</div>

**Steps to Reproduce**

1. Create a custom version of the UGameViewportClient and overload the Draw() method
  1. In the Draw() method, before calling Super::Draw() set the bDisableWorldRendering to true.

2. Implement an actor with one or multiple USceneCaptureComponents and trigger their scene captures manually in the Tick() method of your actor
3. Load some non empty map
4. Let the game run and track its RAM usage  
[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Svegn2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/svegn2/32/924220_2.png) [@Svegn2](https://forums.unrealengine.com/u/Svegn2)\
**Post date:** [October 20, 2026, 8:13pm UTC](https://forums.unrealengine.com/t/memory-leak-when-rendering-scene-captures-without-the-game-viewport/2858980/3 "2026-10-20T20:13:23Z")

</div>

Hi,

Calling ResetAndShrinkModifiedBounds should be a proper workaround while the engine team works on a permanent fix. I created a temp patch that should help you avoid leaking until the bug can be properly addressed in a future release.

Regards,

Martin

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 21, 2026, 6:39am UTC](https://forums.unrealengine.com/t/memory-leak-when-rendering-scene-captures-without-the-game-viewport/2858980/4 "2026-10-21T06:39:02Z")

</div>

Thanks for the fast reply and the patch. We will merge it into our engine branch.

[Attachment Removed]
