Memreport命令 - muchenhen/UnrealEngineMemreportParser GitHub Wiki

Memreport命令

命令接受的地方在:Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp

bool UEngine::HandleMemReportDeferredCommand( const TCHAR* Cmd, FOutputDevice& Ar, UWorld* InWorld )

输入Memreport -full会输出更详细的报告。

报告保存在Game/Saved/Profiling/MemReports目录下,文件格式为.memreport,是一个普通的文本文件,可以直接打开查阅

BaseEngine.ini中的配置可以自定义相关命令的额外选项

[MemReportCommands]
; These commands are run when memreport is executed, and output to a profile file
+Cmd="Mem FromReport"
+Cmd="LogCountedInstances"
+Cmd="obj list -alphasort"
+Cmd="rhi.DumpMemory"
+Cmd="LogOutStatLevels"
+Cmd="ListSpawnedActors"

[MemReportFullCommands]
; Additional commands to run with memreport -full
+Cmd="DumpParticleMem"
+Cmd="ConfigMem"
+Cmd="r.DumpRenderTargetPoolMemory"
+Cmd="ListTextures"
+Cmd="ListSounds -alphasort"
+Cmd="ListParticleSystems -alphasort"
+Cmd="obj list class=SoundWave -alphasort"
+Cmd="obj list class=SkeletalMesh -alphasort"
+Cmd="obj list class=StaticMesh -alphasort"
+Cmd="obj list class=Level -alphasort"
+Cmd="obj list class=StaticMeshComponent -alphasort"

每次通过CMD调用该命令,会生成一个当前内存使用情况的Memreport文件,在实际的使用过程中,一般会在游戏的不同阶段分别调用生成不同时间点的内存情况来查找问题。