Hello !
I found a weird issue on our project.
When going from on level to another, some of the Global Distance Buffer seem’s to be duplicated in memory.
it’s happen if we load another level that end up with a different "Lumen Scene View Distance than the previous one. the more you do it, the more you end up with those buffer.
i was able to repro this in our project in PS5 and PC build when going back and forth from the menu and other level.
And in editor (Actual project and New Empty Project) by just loading level which had a different Lumen Scene View Distance.
[Attachment Removed]
Hi,
Thanks for reporting. Indeed we had some issues with Global Distance Field resource references. It should be fixed now in CL#50207022 (ue5-main):
GlobalDistanceField - fixed pooled buffer and texture memory leaks
* Remove TRefCountPtr from FGlobalDistanceFieldParameterData as it’s a POD memset to 0
* Remove TRefCountPtr from FGlobalDistanceFieldInfo as it’s a transient structure assumed to be POD (see FGlobalDistanceFieldInfo& GlobalDistanceFieldInfo = *Allocator.Create<FGlobalDistanceFieldInfo>(); in class FViewInfo)
* Remove TRefCountPtr from FNiagaraGpuComputeDispatch::FCachedDistanceFieldData as we initialize it from a transient FGlobalDistanceFieldParameterData (valid only for rendering one frame). Niagara can hold to FNiagaraGpuComputeDispatch objects without rendering them, but CachedGDFData can be only released through PreInitViews()/PostRenderOpaque() which won’t be called on a such object.
[Attachment Removed]
Hello,
We encountered the same issue and cherry picked CL 50207022. It fixes the leak of the large alloc labeled as GlobalDistanceField.PageObjectGridBuffer but PageAtlas, CoverageAtlas and some other smaller allocs still seem to leak. See screenshots below of before and after a PIE session (play in viewport) of an empty level.
[Image Removed]
Is it possible that struct FPersistentGlobalDistanceFieldData (ScenePrivate.h) needs to also be fixed?
Thank you,
Eric
[Attachment Removed]
I looked at it, and it seems like GlobalDistanceFiled correctly decreases references of PooledRenderTargets in ComputeUpdateRegionsAndUpdateViewState to 1, later FRenderTargetPool::TickPoolElements() pick up those targets and decreases them to 0. No sure why they aren’t deallocated, but it doesn’t seem to be related to distance fields.
I also don’t see those extra resources on r.DumpRenderTargetPoolMemory 1 list.
You can try debugging further from here or make a new ticket, so someone who works on render target pools can take a look.
[Attachment Removed]