1 Reply Latest reply on Apr 3, 2011 9:02 PM by Flex harUI

    Who can help me? is it a issue of Memory leak?

    gthank

          First , I have a poor English, sorry!

          I have a project , and the project has two States, click the button to change the State.

      I run the Application, I can see the memory is 39MB. After I change the State several times,

      and the memory increases to 43MB.

          My Application has a s:TextInput and s:TextArea, when I change the focus between them,

      I find the memory increase to 55MB, and continue increasing if you do the same action.

      In my surprise, if I use mx:TextInput and mx:TextArea, the problem is disappeared.

       

          I doubt this is a memory leak, I test the TourDeFlex, and it has the same problem.

      My environment is Flex SDK 4.1, and air 2.6.

       

        Finally I paste my Source here:

       

      //---------------------------------------------------------------------------------------- --------------
      <?xml version="1.0" encoding="utf-8"?>
      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark"
              xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:ns1="*" currentState="S2"  height.S1="455">
      <fx:Script>
        <![CDATA[
         protected function button1_clickHandler(event:MouseEvent):void
         {
          this.currentState="S2";
         }
         protected function button2_clickHandler(event:MouseEvent):void
         {
          this.currentState="S1";
         }
        ]]>
      </fx:Script>
      <s:states>
        <s:State name="S1"/>
        <s:State name="S2"/>
      </s:states>
      <fx:Declarations>
        <!-- 将非可视元素(例如服务、值对象)放在此处 -->
      </fx:Declarations>
      <s:Button includeIn="S1" x="47" y="318" label="按钮" click="button1_clickHandler(event)"/>
      <s:ComboBox includeIn="S1" x="47" y="84"/>
      <mx:DataGrid includeIn="S1" x="47" y="151">
        <mx:columns>
         <mx:DataGridColumn headerText="列 1" dataField="col1"/>
         <mx:DataGridColumn headerText="列 2" dataField="col2"/>
         <mx:DataGridColumn headerText="列 3" dataField="col3"/>
        </mx:columns>
      </mx:DataGrid>
      <s:TextArea includeIn="S2" x="52" y="71"/>
      <s:TextInput includeIn="S2" x="52" y="25"/>
      <s:Button includeIn="S2" x="52" y="258" label="按钮" click="button2_clickHandler(event)"/>
      </s:WindowedApplication>
      //---------------------------------------------------------------------------------------- --------------------------