Texture2d www.texture Memory leak in coroutine?

I am getting WWW images onto some cubes from a google image search and the memory goes above 1gb after 20 pics, and when i stop Play the memory only goes back to 900mb until i restart the Unity Editor.

I have checked all the forums for solutions and have tried about 10 different solutions.

Can you find a logical reason why www.textures are being lost inside memory and i can’t delete them?

 var tex2d[] = new Textre2D[100];
 var ZZ =0;
 var foundpics = 0;

 function imgcube( imgURL : String , cubename : String ){
 //function called inside loop for 10 imgURL's
var loopbreak = 0;
var www = new WWW(imgurl);

yield www;
ZZ ++;
tex2d[ZZ] = www.textureNonReadable;

while( loopbreak < 10 )
{
	yield WaitForFixedUpdate();
	loopbreak ++;
	if( www.isDone == true )
	if(tex2d[ZZ].width < 256 || tex2d[ZZ].height < 256)            
    {break;} 
	else 
	{
	
		foundpics +=1;
		var cube = GameObject.CreatePrimitive( PrimitiveType.Cube ) ;
		cube.GetComponent(Renderer).material.mainTexture = new Texture2D(4, 4, TextureFormat.DXT1, false);
		cube.transform.position = Vector3(-4+foundpics%10,Mathf.Floor(foundpics/10),-20);
		www.LoadImageIntoTexture(cube.GetComponent(Renderer).material.mainTexture);
		//cube.renderer.material.mainTexture = tex2d[ZZ];

		//Destroy(cube);
        (cube.renderer.material.mainTexture);
		//Destroy(tex2d[ZZ]);
		tex2d[ZZ] = null;
		Resources.UnloadAsset(tex2d[ZZ]);

		DestroyImmediate(www.texture);
		DestroyImmediate(tex2d[ZZ]);
		
		var  op : AsyncOperation = Resources.UnloadUnusedAssets();
		while (!op.isDone) yield WaitForFixedUpdate();
		System.GC.Collect();
		
		www.Dispose();
		Resources.UnloadUnusedAssets();
		break;
		
	}
	
	if (loopbreak >10) break;
}

}

Memory seems to hold steady with this.

        // Use this for initialization
        IEnumerator Start()
        {
            Texture2D oldTexture = null;
            while (true)
            {
                WWW www = new WWW(_mUrl);
                yield return www;
                Texture2D newTexture = www.texture;
                _mMaterialInstance.mainTexture = newTexture;
                www.Dispose();
                if (oldTexture)
                {
                    DestroyImmediate(oldTexture);
                }
                oldTexture = newTexture;
                yield return null;
            }
        }

From some research on similar problems, it seems that you don’t want to ever reference WWW.texture since that creates a resource behind the scenes that never goes away.

Your call to DestroyImmediate(www.texture) is actually creating the instance it then tries to destroy.

Also, how big are your textures? They are uncompressed in memory when you load them, so for example a jpeg file might be small, but uncompressed into a full sized uncompressed image could be very large.