flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Zwaga <rol...@stackandheap.com>
Subject Re: InstallApacheFlex - Optional components
Date Thu, 05 Jul 2012 06:54:09 GMT
> Since we are unzipping the files in actionscript, ADL's memory footprint is
> ballooning up to more than 1+ GB.  This is causing the unzipping to crash
> with a "Error #1000: The system is out of memory." error.
> Even though my computer has 8 Gigs of RAM, ADL has an limit of around 1GB
> per app.  So, this is expected behavior.
> I really wish we dint have to download the Adobe Flex 4.6 zip file at all.
> The other option is to ship 7-Zip along with the app and use it instead of
> FZip.  I am not sure if memory used by a NativeProcess counts towards the
> ADL memory limit.
> Any other ideas?

Hey Om,

I just had a quick look at the code and I see that for each call to: var
fzip:Zip = new Zip();
and subsequently adding event listeners, there isn't any clean up done.
Clean up, as in an explicit call to fzip.close() and removal of *all* event
listeners (there's 3 added and only 2 removed).
I'm guessing adding this to the code will make sure that a Zip instance
will be properly garbage collected
after its used, thus keeping the memory from ballooning.

So this method should at the very least look like this:

private function onUnzipComplete(event:Event):void
var fzip:Zip = event.target as Zip;
       * fzip.close();*
 fzip.removeEventListener(ZipEvent.FILE_LOADED, onFileLoaded);
fzip.removeEventListener(Event.COMPLETE, onUnzipComplete);

The dynamic Event.COMPLETE listener (unzipCompleteFunction) might be added
as a weak listener I guess.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message