Version: 2019.3
LanguageEnglish
  • C#

MemorySnapshot

class in UnityEditor.MemoryProfiler

/

Implemented in:UnityEditor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

MemorySnapshot is a profiling tool to help diagnose memory usage.

MemorySnapshot, and all types in UnityEditor.MemoryProfiler.* are very experimental API, and will very likely change significantly going forward. Currently only il2cpp-based players are able to provide memory snapshots. The editor, and mono-based players will not respond to requests for new snapshots.

Static Methods

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

OnSnapshotReceivedEvent that will be fired when a new memory snapshot comes in through the profiler connection. Its argument will be a PackedMemorySnapshot.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961