Unity Memory Profiler
2022/09
05
16:09
一、安装插件
在Package Manager中,找到Memory Profiler,安装
二、在代码中,导出内存快照
var filename = System.DateTime.Now.ToString("yyyyMMddHHmmss.snap");
UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeSnapshot(filename, OnHeapReceivedSaveOnly);
private static void OnHeapReceivedSaveOnly(string path, bool captureResult)
{
}
三、构建Android包的时候,使用Development模式构建
四、在运行过程中,调用以上代码,触发保存
五、打开 Windows / Analysis / Memory profiler,分别导入2个快照文件
然后Compare Snapsshots
CopyRights: The Post by BY-NC-SA For Authorization,Original If Not Noted,Reprint Please Indicate From 老刘@开发笔记
Post Link: Unity Memory Profiler
Post Link: Unity Memory Profiler