Why does a 1024*1024 Texture2D use so much memory?

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

Texture2D’s created in code are read-write, so there is a copy outside texture memory, just as for an imported Texture2D with isReadable set to true. When you have finished modifying the Texture2D, use the makeNoLongerReadable parameter of Texture2D.Apply() to discard the in-memory copy.

I am not sure if temporary garbage adds to the count or not. If it does, then those 8+ MB might actually be to some part garbage that haven’t been collected.

You could try to collect all garbage to see if it does any difference.

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();

            // ************************************************************
            // Lines below are added to collect garbage and wait for thread
            // ************************************************************

            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
    }
}