mallocleak.start

mallocleak.start

#Overview

name: mallocleak.start

This variable is created as a Console Variable (cvar).

It is referenced in 2 C++ source files.

#Summary

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ProfilingDebugging/MallocLeakReporter.cpp:161

Scope: file

Source code excerpt:


static FAutoConsoleCommand LeakReporterStartCommand(
	TEXT("mallocleak.start"),
	TEXT("Starts tracking allocations. Args -report=[secs] -size=[filter]"),
	FConsoleCommandWithArgsDelegate::CreateLambda([](const TArray<FString>& Args) {
		FString ArgString = FString::Join(Args, TEXT(" "));
		int32 Size = 0;
		float ReportTime = 0;
		FParse::Value(*ArgString, TEXT("size="), Size);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ProfilingDebugging/MallocLeakReporter.h:19

Scope: file

Source code excerpt:

	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

 */
class FMallocLeakReporter
{
	DECLARE_MULTICAST_DELEGATE_TwoParams(FMallocLeakReportDelegate, const int32, const int32);

public:
	struct EReportOption
	{
		enum
		{
			ReportLeaks = (1 << 0),
			ReportAllocs = (1 << 1),
			ReportMemReport = (1 << 2),

			ReportAll = ReportLeaks | ReportAllocs | ReportMemReport,
		};
	};