Version: 2019.4
LanguageEnglish
  • C#
Method group is Obsolete

Profiler.GetMonoHeapSize

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

Obsolete GetMonoHeapSize has been deprecated since it is limited to 4GB. Please use GetMonoHeapSizeLong() instead.

Declaration

public static uint GetMonoHeapSize();

Description

Returns the size of the mono heap.

This is the reserved system memory that Mono is using for allocations.

using UnityEngine;
using UnityEngine.Profiling;

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