Why does a 1024*1024 ARGB32 Texture2D use more than 8MB total memory? I think the correct cost is 4MB (4MB = 1024 * 1024 * 32bit / 8 / 1024 / 1024).
I just did a test on Unity3.3 pro. Create an empty project only included a empty scene. Create bellow script:
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
public Texture2D tt;
void OnGUI () {
if (GUILayout.Button("Create Texture2D")) {
tt = new Texture2D(1024, 1024, TextureFormat.ARGB32, false);
Resources.UnloadUnusedAssets();
}
}
}
Drag this script to scene.
When I click the button on run time. The profiler of unity display that Textures memory add 4MB but Total memory add more than 8MB.
Here are two screenshots:
Before Create a 1024*1024 ARGB32 Texture2D:
Total: 270.5 MB Delta: 0 B
Texture: 770 / 2.5 MB
Meshes: 26 / 74.9 KB
AnimationClips: 0 / 0 B
Total Object Count: 1134
After Create a 1024*1024 ARGB32 Texture2D:
Total: 279.3 MB Delta: 0 B
Texture: 771 / 6.5 MB
Meshes: 26 / 74.9 KB
AnimationClips: 0 / 0 B
Total Object Count: 1116