Runtime Memory Size
Last updated
Last updated
This provides the total memory usage of a Unity object at runtime, including all associated resources. It is useful for profiling and optimization, as it gives the actual runtime memory footprint, which might differ from the raw size of the data.
But, note that due to alignment or GPU chunking, small objects (like a simple cube) might show disproportionately high memory usage.
CPU Memory: The memory used for object data stored on the CPU (e.g., vertices, indices, and other attributes like UVs, normals, and tangents).
GPU Memory: The memory used for the same data once it’s uploaded to the GPU for rendering.
Extra Copies: If the object has Read/Write Enabled, Unity keeps a duplicate copy of the mesh on the CPU, increasing memory usage.
Alignment or Overhead: Memory overhead from alignment or padding required by hardware (e.g., GPUs may allocate in chunks, often 4 MB)
Since Runtime Memory Size includes the impact on the CPU side and GPU side, it may appear to be double what you might expect. In Editor, both CPU and GPU copies are always loaded, but in players, marking the texture as Read-Only should mean you only have the GPU copy.
Unity's memory profiler might include overhead in the reported value or lump related resources together. For example, the memory reported might include:
Vertex and index buffers.
Normals, tangents, UVs, and other optional data.
Metadata or extra copies required for internal operations (e.g., for the GPU or CPU).
For small objects, even minor overheads can appear disproportionately large.