Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetAllocatedMemoryForGraphicsDriver()

Returns the estimated amount of allocated memory for the graphics driver, in bytes.
Read time 1 minuteLast updated 6 days ago

Definition

public static long GetAllocatedMemoryForGraphicsDriver()

Returns

Type

Description

longEstimated used graphics memory in bytes. Returns 0 in Release Players.

Remarks

Use to obtain a value of the graphics memory used by all allocated graphics resources such as textures, meshes, compute and geometry buffers. The value is estimated based on the properties of created graphics resources which are allocated using graphics scripting API as well as internal graphics resources used by the Unity engine.
Note: Only available in development players and the Unity Editor.
using UnityEngine;using UnityEngine.Profiling;public class ExampleClass : MonoBehaviour{ void Update() { Debug.Log("Estimated used graphics memory: " + Profiler.GetAllocatedMemoryForGraphicsDriver() + " Bytes"); }}