4 Replies Latest reply on Feb 28, 2010 12:44 AM by sasa555

    memory leaks while playing mp3 in air 1.5

    sasa555

      Hello,

       

      I am trying to develop an mp3 player using Adobe Air (html + javascript). When I repeatedly load files using Sound class, memory usage is constantly increasing. I have observed this on OS X 10.6. using Activity Monitor. Air runtime is 1.5.3.9120

       

       

      Steps to reproduce:

      1. Load the sample below with adl

      2. Click on play. Observer memory usage of adl in Activity monitor

      3. Click on stop. The memory doesn't get reclaimed.

       

      Keep repeating steps 2 and 3 and observe the memory in Activity monitor.

       

      Any ideas as to why this happens? What am I doing wrong?

       

      Regards,

      Sasa

       

      The example:

       

      <html>
        <head>
          <script type="text/javascript" src="AIRIntrospector.js"></script>     
          <script type="text/javascript" src="AIRAliases.js"></script>
         
          <script type="text/javascript">
            function play(){
              var req = new air.URLRequest("file://test.mp3");
              snd = new air.Sound(req);
              //channel = snd.play();
            }
           
            function stop(){
              //channel.stop();
              //channel = null;
              snd = null;
            }
         
            function init(){
              document.getElementById('play').onclick = play;
              document.getElementById('stop').onclick = stop;
            }
          </script>
        </head>
       
        <body onload="init();">
          <div id="play">play</div>
          <div id="stop">stop</div>
        </body>
      </html>