Return-Path: X-Original-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 28DBBD6DF for ; Thu, 5 Jul 2012 07:19:56 +0000 (UTC) Received: (qmail 36717 invoked by uid 500); 5 Jul 2012 07:19:55 -0000 Delivered-To: apmail-incubator-flex-dev-archive@incubator.apache.org Received: (qmail 36670 invoked by uid 500); 5 Jul 2012 07:19:54 -0000 Mailing-List: contact flex-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flex-dev@incubator.apache.org Delivered-To: mailing list flex-dev@incubator.apache.org Received: (qmail 36641 invoked by uid 99); 5 Jul 2012 07:19:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2012 07:19:53 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of omuppi1@gmail.com designates 209.85.217.175 as permitted sender) Received: from [209.85.217.175] (HELO mail-lb0-f175.google.com) (209.85.217.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2012 07:19:48 +0000 Received: by lbol5 with SMTP id l5so10881200lbo.6 for ; Thu, 05 Jul 2012 00:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=7zmeAWM2sZp0oBlYcPwyhNXct7H2WKc1pkGbJ5x5G/k=; b=Gi+7d3xCnI840KtyNyYzEzvGUup1fEhEpeb2H/OilswUZv3zavWnCQzrvpyQCL7XBB gTwG+XOvn4XNasPdEBAWNeOhBtaJp59jenJxIPzheb2VLzdF5l8sAHv96NNwIM8fpLRs DFPsJODFvFmAQzCUOEI6yWswW0qazpJ0iOsLOE2W5zfinLg5WZMKcb5LDsXQN837mJQx nkaOT58W3qZVdFUH5VuLh0QLRGAh9Jjy658Q4K0eJP7QNOO7dnZIxt2ct3s9zkspl7vV p+uQA2WYpEjizmS6Y0grpguKN36DANPpC0Iqahh7l+jVh8T+JuXBQCQ9MXnNxE04/A76 2qcg== Received: by 10.152.136.18 with SMTP id pw18mr24709491lab.17.1341472767182; Thu, 05 Jul 2012 00:19:27 -0700 (PDT) MIME-Version: 1.0 Sender: omuppi1@gmail.com Received: by 10.112.82.73 with HTTP; Thu, 5 Jul 2012 00:18:57 -0700 (PDT) In-Reply-To: References: From: Om Date: Thu, 5 Jul 2012 00:18:57 -0700 X-Google-Sender-Auth: uEWmMkJtgcs4DhSCLbJiQdbnlZ8 Message-ID: Subject: Re: InstallApacheFlex - Optional components To: flex-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=f46d042f927ac3855b04c40ff7cb X-Virus-Checked: Checked by ClamAV on apache.org --f46d042f927ac3855b04c40ff7cb Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jul 4, 2012 at 11:54 PM, Roland Zwaga wrote: > > > > 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. > > cheers, > > Roland > Yup, my bad. Pretty big memory leaks because I am not cleaning things up properly . I have added a few checks since, but I will add your suggestions as well. Thanks for catching that. BTW, I am sure there are other similar issues with the codebase, it would do good to the codebase if it gets more eyballs :-) Thanks, Om --f46d042f927ac3855b04c40ff7cb--