AsyncLoadingScreen icon indicating copy to clipboard operation
AsyncLoadingScreen copied to clipboard

Background images loaded at startup can't be collected by GC afterwards

Open Snowball2012 opened this issue 3 years ago • 0 comments

Hello,

FAsyncLoadingScreenModule::StartupModule calls SetupLoadingScreen(Settings->StartupLoadingScreen) at module startup time. That happens while disregard for gc pool is still open, so all UObjects loaded at this stage (e.g. background textures in SBackgroundWidget) can't be released by gc later and can consume a portion of gpu memory as long as the module is loaded (entire process lifetime basically). This doesn't happen with other loading screens because they are constructed much later, after CloseDisregardForGC is called.

You can see this behaviour if you specify some texture in BackgroundSettings for startup screen and call obj refs name= <TextureName> after the game has loaded. The background texture will be marked as root and thus won't be collected by GC:

(root) (standalone)  MetaData /Game/<TexturePath>
 -> UObject* UObject::Outer = (root)  Package /Game/<TexturePath>

Snowball2012 avatar Apr 26 '22 12:04 Snowball2012