Search the Community
Showing results for tags 'Queue'.
-
Hi, Just need to sanity check what I am doing and get best advice on clearing loadermax queue (and contents) from memory. So, I am using a LoaderMax queue in Air to download & store locally a series of assets (images, videos, pdfs). _queue.append(new DataLoader(itemURL, {name:itemID, format:"binary", estimatedBytes:_estBytes_general, autoDispose:true}) ); I should say at this point I am not yet doing the saving to local filesystem (so that is not influencing memory) So, Potentially I may have 100's of MB of files which may kill the app if I wait until the end of the queue. So as a queue "child" loads in, I am (going to) save to file, then I kill of the child & it's contents. I also call garbage collection at this point (Air only). function queueChildComplete(event:LoaderEvent):void { event.target.unload(); _queue.remove(event.target as LoaderCore); System.gc(); } When the entire queue completes, I then call the following to clear the queue from memory (not that their should be anything in there anymore). _queue.unload(); _queue.dispose(true) _queue.empty(true,true); System.gc(); Don't think I need to be calling all of those unload, dispose & empty.. but you know belt & braces! Now the problem is, when I trace System.privateMemory before (just before queue.load) & after the operation, memory has increased by the size of the files downloaded. 1) What is the text book method of disposing of a queue, and it's contents .. totally from memory (knowing that I will have re instantiate it later). 2) Do you have a handy tool that will stream files directly to the local filesystem for AIR apps (using urlstream perhaps). Many Thanks
- 6 replies
-
- Memory
- DataLoader
-
(and 2 more)
Tagged with: