This is more of a question regarding how files are stored when downloading them through the WWW class. Once a file is successfully downloaded from a server using WWW, is the file placed some place physically on the client side, or is everything just stored in a big cache blob of some kind?
I also noticed that the time taken to download the file also doesn’t correspond to actually accessing the data in the file. In other words, if I download about 50 1 MB files, they all download, according to my logs and WWW’s isDone and error != null property, along with some timestamps, within 1 second. However, when I actually go to access the texture through the texture property, there seems to be additional lag, so it’s like the physical contents of the file are getting loaded at that point? Also, the memory seems to drop a lot at this point, so I’m guessing this is when the actual Texture2D is allocated? If so, what is in the WWW object before this access is done that takes up so much less space?
The last question is, eventually, after accessing about 20 of these files (~29 MB from my calculations), the unity run browser crashes due to being out of memory (d3d: out of memory). If I don’t access the texture property at all, and just store the WWW objects by their lonesome, I don’t have any out of memory crash. Is this the purpose of downloading an entire AssetBundle, to sort of cram more data into a compressed bundle to save memory in this instance? Also, would there be a way to free up that Texture2D if I don’t need it anymore? The texture property is readonly, so I can’t set it to null afterwards, and I wouldn’t want to null out the WWW, since then I take it the downloaded file itself is then no longer accessible?