Version: 2017.3

MemorySnapshot

class in UnityEditor.MemoryProfiler

切换到手册

描述

MemorySnapshot 是一个用于帮助诊断内存使用情况的分析工具。

MemorySnapshot 以及 UnityEditor.MemoryProfiler.* 中的所有类型都是实验性 API,未来很可能发生显著变化。目前,只有基于 il2cpp 的播放器能够提供内存快照。编辑器和基于单声道的播放器不会响应对新快照的请求。

静态函数

RequestNewSnapshotRequests a new snapshot from the currently connected target of the profiler. Memory snapshots are supported on IL2CPP and Mono .NET 3.5 scripting backends. NOTE: Each snapshot consists of approximately one managed object per recorded managed object. Snapshots taken from the editor will contain the objects in all previous snapshots that have not yet been garbage-collected. Therefore, repeated snapshots of the editor may grow exponentially. If you no longer need an old snapshot it is therefore advisable to null all references to it and call GC.Collect() before taking another one.

Events

OnSnapshotReceived当新内存快照通过性能分析器连接传入时将触发的事件。它的参数将是 PackedMemorySnapshot。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961