Android crashes while receiving multiple files from UnityWebRequest

Hi guys,

i have a problem puzzling me for some days. Basically i have created a grid of sprites and i am downloading many pictures from the web.

The problem is that my app crashes if i download many of them ( 150 or so). I am receining the picture using the UnityWebrequestTexture and then DownloadHandlerTexture.
After that i apply it to the sprite and then i save it to the device storage using File.WriteAllbytes.

I tried using delay ( IEnumerator for each request with a delay of 1 sec but even then it crashes.

I saw somewhere that this is issue has to do with memory usage and i should use streams.

Any ideas?

thanks in advance

you could setup a simple queue that holds several items to be processed, when one is removed for processing another parallel task could be retrieving another to put in the queue. In that way you could control how many objects you have in memory while you process them.