Description

When executing "ShowFlag.Rendering 0", it occur the memory leak because it can't run RHICmdList.ImmediateFlush().

 

The following code is a workaround. DEC_MEMORY_STAT_BY() is ImmediateFlush. Without this code, only INC_MEMORY_STAT_BY() is executed.

void FDeferredShadingSceneRenderer::Render(FRHICommandListImmediate& RHICmdList)
{
...
if (!ViewFamily.EngineShowFlags.Rendering)
{
+ if (GRHINeedsExtraDeletionLatency || !GRHICommandList.Bypass())
+ {
+ RHICmdList.ImmediateFlush(EImmediateFlushType::FlushRHIThreadFlushResources);
+ }
return;
}
...
}
void FMobileSceneRenderer::Render(FRHICommandListImmediate& RHICmdList)
{
...
if(!ViewFamily.EngineShowFlags.Rendering)
{
+ if (GRHINeedsExtraDeletionLatency || !GRHICommandList.Bypass())
+ {
+ RHICmdList.ImmediateFlush(EImmediateFlushType::FlushRHIThreadFlushResources);
+ }
return;
}
...
}
Steps to Reproduce

1. Launch standalone game with "-d3d12" argument from editor
2. Exec "ShowFlag.Rendering 0"
3. Exec "Stat MemoryPlatform"

Then, it can see increasing Used Physical memory.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-79676 in the post.

1
Login to Vote

Won't Fix
ComponentUE - Rendering
Affects Versions4.214.22
CreatedSep 2, 2019
ResolvedAug 27, 2021
UpdatedAug 27, 2021