CollectGarbage

Deletes all unreferenced objects, keeping objects that have any of the passed in KeepFlags set.

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

void CollectGarbage
(
    EObjectFlags KeepFlags,
    bool bPerformFullPurge
)

Remarks

Deletes all unreferenced objects, keeping objects that have any of the passed in KeepFlags set. Will wait for other threads to unlock 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