engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Protected 成员函数 | 所有成员列表
FMallocLeakReporter类 参考

FMallocLeakReporter is a helper class that works alongside FMallocLeakDetection to provide easy access to reports of low-level memory leaks. 更多...

#include <MallocLeakReporter.h>

Public 成员函数

void Clear ()
 Clears all accumulated data
 
bool IsEnabled () const
 Returns our enabled state 更多...
 
void SetDefaultAllocReportOptions (const FMallocLeakReportOptions &Options)
 Sets default options for reporting allocations 更多...
 
void SetDefaultLeakReportOptions (const FMallocLeakReportOptions &Options)
 Sets default options for what are considered memory leaks 更多...
 
void Start (int32 FilterSize=0, float ReportOnTime=0.0f)
 Starts tracking allocations. 更多...
 
void Stop ()
 Stop tracking leaks
 
int32 WriteReport (const TCHAR *ReportName, const FMallocLeakReportOptions &Options)
 Writes out a report according to the passed in options
 
int32 WriteReports (const uint32 ReportFlags=EReportOption::ReportAll)
 Writes out a set of reports according to our defaults
 

静态 Public 成员函数

static FMallocLeakReporter & Get ()
 Return singleton instance
 

Protected 成员函数

void Checkpoint ()
 Called internally to generate rate checkpoints
 
 FMallocLeakReporter ()
 Private constructor
 

详细描述

FMallocLeakReporter is a helper class that works alongside FMallocLeakDetection to provide easy access to reports of low-level memory leaks.

The reporter can be operated from the console where it can be started/stopped and used to periodically or manually report leaks, or it can be called from game code to implemnent this funtionality at desired times.

Example Console Usage:

"mallocleak.start report=300" - start tracking leaks and generate a report every 300 secs "mallocleak report" - report allocations and leaks "mallocleak stop" - stop tracking leaks

Example Code usage

FMallocLeakReporter::Get().Start(0, 300) - start tracking allocs > 0KB and generate a report every 300 secs FMallocLeakReporter::Get().WriteReports() - Writes reports and returns the number of suspected leaks FMallocLeakReporter::Get().WriteReport(TEXT("BigAllocs"), Options); - Write custom report of allocations that matches "Options" FMallocLeakReporter::Get().Stop() - stop tracking allocations

Reports are written to the profiling dir, e,g GameName/Saved/Profiling/SessionName

成员函数说明

◆ IsEnabled()

bool FMallocLeakReporter::IsEnabled ( ) const
inline

Returns our enabled state

返回
: bool

◆ SetDefaultAllocReportOptions()

void FMallocLeakReporter::SetDefaultAllocReportOptions ( const FMallocLeakReportOptions &  Options)
inline

Sets default options for reporting allocations

参数
Options
返回
: void

◆ SetDefaultLeakReportOptions()

void FMallocLeakReporter::SetDefaultLeakReportOptions ( const FMallocLeakReportOptions &  Options)
inline

Sets default options for what are considered memory leaks

参数
Options
返回
: void

◆ Start()

void FMallocLeakReporter::Start ( int32  FilterSize = 0,
float  ReportOnTime = 0.0f 
)

Starts tracking allocations.

参数
FilterSize Only track allocations >= this value in KB. Higher values affect performance less
ReportOnTime Write out a report every N seconds
返回
: void

该类的文档由以下文件生成: