Version: 2019.4

MemorySnapshot

class in UnityEditor.MemoryProfiler

マニュアルに切り替える

説明

MemorySnapshot はメモリの使用状況を診断するためのプロファイリングツールです。

MemorySnapshot と UnityEditor.MemoryProfiler.* のすべての種類は非常に実験的な API です。今後大幅に変更される可能性が高いです。現在、 il2cpp ベースのプレーヤーだけがメモリースナップショットを提供することができます。エディターとモノベースのプレーヤーは新しいスナップショットの要求には応答しません。

Static 関数

RequestNewSnapshotRequests a new snapshot from the currently connected target of the profiler. Memory snapshots are supported on IL2CPP and Mono .NET 3.5/4.0 scripting backends, although .NET 3.5 has been deprecated as of 2018.3. 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

OnSnapshotReceivedProfiler Connection を介して新しいメモリスナップショットが入ってくるときに発生するイベントです。その引数は PackedMemorySnapshot になります。