TryCollectGarbage

Performs garbage collection only if no other thread holds a lock on GC

Windows
MacOS
Linux

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectGlobals.h

Include

#include "UObject/UObjectGlobals.h"

Source

/Engine/Source/Runtime/CoreUObject/Private/UObject/GarbageCollection.cpp

Syntax

bool TryCollectGarbage
(
    EObjectFlags KeepFlags,
    bool bPerformFullPurge
)

Remarks

Performs garbage collection only if no other thread holds a lock on GC

Parameters

Parameter

Description

KeepFlags

objects with those flags will be kept regardless of being referenced or not

bPerformFullPurge

if true, perform a full purge after the mark pass

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss