House of Fusion
Home of the ColdFusion Community
Hostmysite Dedicated Hosting

Search flex

September 07, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30         

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition

For ColdFusion hosting try HostMySite.com.
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  Adobe Flex 2

AIR Clock Memory Leak

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
David Henry
03/25/2008 09:15 AM

Hello again Flex list, My team at work has a problem with a memory leak in our application which we have narrowed down to the clock.  We have made a standalone version of our clock to illustrate the problem (flex3 bug maybe?).  Can anyone explain why this AIR app leaks memory and how to fix it? Clock.mxml :     <?xml version="1.0" encoding="utf-8"?>     <mx:WindowedApplication         xmlns:mx="http://www.adobe.com/2006/mxml"         layout="absolute"         creationComplete="init();"      >         <mx:Script>             <![CDATA[                            import flash.utils.Timer;                 import flash.events.TimerEvent;                                [Bindable]                 private var dateAndTime:String;                 private var theDate:Date;                 private var theTimer:Timer;                                private function createTimer():void                 {                     theTimer = new Timer(1000, 0);                     var theEvent:String = TimerEvent.TIMER;                     var useCapture:Boolean = false;                     var eventPriority:uint = 0;                     var useWeakReference:Boolean = true;                     theTimer.addEventListener(theEvent, timerListener,     useCapture, eventPriority, useWeakReference);                     theTimer.start();                 }                                private function init():void                 {                     createTimer();                 }                                private function timerListener(event:TimerEvent):void                 {                     theDate = new Date();                     dateAndTime = theDate.toLocaleString(); //leak seems     to happen here.                 }             ]]>         </mx:Script>         <mx:Label id="dateAndTimeLBL"             text="{dateAndTime}"             right="10"             top="122"             color="#000000"              fontSize="28"              textAlign="center"              width="501"          />            </mx:WindowedApplication> Thanks for your input! David -- [Image:Our Hero] David Henry http://ColdFusionPowered.com/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Douglas Knudsen
03/25/2008 09:34 AM

You can submit a bug to the bug base http://bugs.adobe.com/flex/ DK On Tue, Mar 25, 2008 at 9:15 AM, David Henry < DavidHenry@coldfusionpowered.com> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Gareth Arch
03/25/2008 09:52 AM

Is there a way to remove the event listener each time the timerListener is fired? private function timerListener(event:TimerEvent):void                 {                     theTimer.removeEventListener(TimerEvent.TIMER, timerListener, false, 0, true);                     theDate = new Date();                     dateAndTime = theDate.toLocaleString(); //leak seems     to happen here.                 } but still keep the timer firing and listening for the events? ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jeffry Houser
03/25/2008 12:38 PM

  Have you tried using the Flex profiler to help narrow it down? David Henry wrote: ----- Excess quoted text cut - see Original Post for more ----- -- Jeffry Houser Flex, ColdFusion, AIR AIM: Reboog711  | Phone: 1-203-379-0773 -- Adobe Community Expert <http://www.adobe.com/communities/experts/members/JeffryHouser.html>; My Company: <http://www.dot-com-it.com> My Podcast: <http://www.theflexshow.com> My Blog: <http://www.jeffryhouser.com>

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan Clover
03/25/2008 11:17 AM

Yes, I thought that might work as well. I used: theTimer.removeEventListener(TimerEvent.TIMER, timerListener); But, according to the Flex 3 profiler...the timer still eats up 1kb per second. Thanks!


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists