文档

Unity Engine

Unity Engine

GetMonoHeapSize()

Returns the size of the heap for managed memory.
阅读时间1 分钟最后更新于 15 天前

Definition

警告
Deprecated. GetMonoHeapSize has been deprecated since it is limited to 4GB. Please use GetMonoHeapSizeLong() instead.
public static uint GetMonoHeapSize()

Returns

Type

Description

uint

Remarks

This is the reserved system memory that Unity uses for allocations.

Examples

using UnityEngine;using UnityEngine.Profiling;public class Example : MonoBehaviour{ void Update() { #if ENABLE_PROFILER Debug.Log("Allocated managed memory heap size" + Profiler.GetMonoHeapSize() + "Bytes"); #endif }}