Hello,
Writing www.bytes to disk leaks memory on iOS.
Mentioned:
http://answers.unity3d.com/questions/938707/does-applicationcapturescreenshot-leak-memory-ios.html
With no responses or solutions aside from not using WWW.
Unfortunately, our backend setup does not allow us to do a Socket connect in that fashion. The only other solution I see is writing a plugin for Android and iOS specifically… which is something I would like to avoid. This seems like a very critical issue.
How to Reproduce:
1.) Host a file somewhere (something of size, like a Texture or Asset Bundle).
2.) Write something like this:
public IEnumerator Coroutine()
{
WWW www = new WWW("endpoint");
yield return www;
System.IO.File.WriteAllBytes("path", www.bytes);
www.Dispose();
//Extra Cleanup just because
www = null;
Resources.UnloadUnusedAssets();
}
3.) Run on device and observe a memory leak
I have created a support ticket with no response so far. Is there something I’m missing? If I’m not, is this something that is going to be fixed soon?
Running on Unity 4.6.4p3