- Home /
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
Answer by YetAnotherKen · Aug 24, 2019 at 08:26 PM
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.
Your answer
Follow this Question
Related Questions
multiple webrequests, one exception causes next to time out, rest are fine 0 Answers
Error getting response stream (Write: The authentication or decryption has failed.): SendFailure 0 Answers
UnityWebRequest blank error message on Hololens 0 Answers
View Generated Source (After AJAX/JavaScript) in Unity 1 Answer