# GetRuntimeMemorySize(Object)

> Returns the runtime memory usage of the resource.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Profiling](/engine/6000.5/script-reference/unityengine/profiling.md)
* **Assembly:** UnityEngine.CoreModule

> **Warning:**
>
> **Deprecated.** GetRuntimeMemorySize has been deprecated since it is limited to 2GB. Please use GetRuntimeMemorySizeLong() instead.

```csharp
public static int GetRuntimeMemorySize(Object o)
```

### Parameters

**** (\[Object]\(/engine/6000.5/script-reference/unityengine/object)):&#x20;

### Returns

| Type                                                       | Description |
| ---------------------------------------------------------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) |             |

### Remarks

This has been implemented for the following resource types: Mesh, Texture, Audio, Animation and Materials Only available in development players and editor.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Profiling;

public class Example : MonoBehaviour
{
    void Update()
    {
        Texture[] textures = Resources.FindObjectsOfTypeAll<Texture>();
        foreach (Texture t in textures)
        {
            Debug.Log("Texture object " + t.name + " using: " + Profiler.GetRuntimeMemorySize(t) + "Bytes");
        }
    }
}
```
