We are observing a memory leak in the Editor when modifying the properties of actors with a Scene Capture component.
The leak is very easy to reproduce. All you need is to have an actor with a Scene Capture component with an already assigned Render Target texture. Then, just modify any of its properties in the Details tab and it leaks a few dozen megabytes of VRAM. In the repro steps I have specified scrubbing a color picker, because it makes it very easy to quickly generate many update events, which can exhaust the VRAM budget in a matter of seconds, but the leak occurs even when editing scalar values in an edit box.
Note: ‘obj gc’ does not reclaim the lost VRAM. I also don’t see anything suspicious in r.DumpRenderTargetPoolMemory.
The leak seems to occur somewhere inside the “Reregister Components” code in AActor::PreEditChange / PostEditChangeProperty methods.
Create a Texture Render Target 2D asset and assign it as the Texture Target of the scene capture component
Add a publicly visible variable of Linear Color type
Place an instance of this the blueprint actor in a level
Select the actor, select the color variable in the Details tab, open the color picker dialog and start scrubbing the cursor around the color wheel continuously
Observe that after just a few seconds of scrubbing, UE will start complaining about running out of VRAM
I was able to reproduce the issue on my end. It occurs when using the color picker dialog, as the property value continuously changes, the SceneCaptureComponent repeatedly requests scene captures, resulting in rapid VRAM usage growth. This behavior can be observed using stat RHI.
To avoid this issue, we recommend disabling CaptureEveryFrame and AlwaysPersistRenderingState on the SceneCaptureComponent2D while using the color picker.
I hope this helps clarify the behavior. Please let us know if you have any additional questions or need further assistance.