Memory issue with UnityWebRequest and images - Unity bug, or my fault?

It appears that I have come across a memory issue wherein either UnityWebRequest or Texture2D does not let go of the texture from memory, and I’d like to get some more eyes on this before submitting it as a bug report (if for no other reason than, I would much prefer this issue get resolved in my own project ASAP). I am currently using 5.6b10.

In a simple tester scene, each frame I am loading the image off my HDD using the UnityWebRequest class with the disposeDownloadHandlerOnDispose flag set to true, and upon finishing the load, it calls UnityWebRequest.Dispose. This might be a flaw with either the Texture2D or the UnityWebRequest keeping things around longer than it should, because even though I am not holding on to references to these textures or sprites being created, in the Profiler under Memory the number of Textures increases every frame.

I’ve attached my code in case I’ve done anything wrong. This is a simplified repro case of what is a much more involved system in the real project, but it exhibits the core issue: texture count increases and never goes away. Am I using any of these incorrectly, or have I found a Unity bug?

(you can test this by just attaching it and setting the URL to some image file that exists on your local drive)

 using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;
using System;
using UnityEngine.Networking;

public class SpriteMemTester : MonoBehaviour {
    public string texturePath = "file:///Users/nothnagr/editorprototype/Builds/iOS/LaunchScreen-iPad.png";

    void Start () {
       
    }

    public Sprite foo;
    int count = 0;
    void Update () {
        UnityWebRequest www = UnityWebRequest.GetTexture (texturePath);
        www.disposeDownloadHandlerOnDispose = true;
        www.Send ();
        StartCoroutine(HandleWebRequest(www));
    }

    public IEnumerator HandleWebRequest(UnityWebRequest www) {
        while (true) {
            yield return 0;
            if (www.isDone) {
                Texture2D tex = DownloadHandlerTexture.GetContent (www);
                Profiler.BeginSample ("Sprite.Create");
                foo = Sprite.Create (tex, new Rect (0, 0, 1, 1), new Vector2 (0.5f, 0.5f));
                Profiler.EndSample ();
                GC.Collect ();
                foo.name = "Created Sprite " + count++;

                www.Dispose ();
                break;
            }
        }
    }
}

Since Sprite inherits from UnityEngine.Object the first thing I’d try is explicitly Destroy()-ing it when you don’t need it anymore.