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; } ... }
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.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-79676 in the post.
1 |
Component | UE - Graphics Features |
---|---|
Affects Versions | 4.21, 4.22 |
Created | Sep 2, 2019 |
---|---|
Resolved | Aug 27, 2021 |
Updated | Aug 27, 2021 |