Memory leaks while playing mp3 in air 1.5

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>

Normally I would agree about letting the gc collect. However, in my case, memory usage increases to 300 MB after 8 hours of playing. It seems that GC didn't collect or I have some more leaks.I didn't have the time to investigate this some more.
However, if gc doesn't collect for such a long time (possibly because there is more than enough free memory), I would prefer to invoke collection myself. If for no other reason, than because it doesn't look good for the end user to have perception that my app is using 300 MB when other applications are using only couple of MB up to 100 MB in the worst cases.

Similar Messages

  • Client-side Memory leak while executing PL/SQL and reading from a view

    Iam noticing memory leaks in OCCI while performing the following:
    Sample function()
    1. Obtain a connection
    2. Create a statement to execute a PL/SQL procedure
    3 Execute the statement created in step #2
    4. Terminate the statement created in step #2
    5. Create a statement to read from a view which was populated
    by executing stored procedure in step #3
    6. Execute the statement created in step #5
    7. Terminate the statement created in step #5
    8. Release the connection
    The PL/SQL populates a view with fixed 65,000 records for every execution. PL/SQL opens a cursor, loads 65000 records and populates the target view and closes the cursor at the end. If i invoke the above function it results in memory leak of 4M for every call. I tried several variants such as:
    1. Disabling statement caching
    2. Using setSQL instead of newly creating second SQL statement
    3. Obtaining two separate connections for these two activities (PL/SQL exec and View read)
    4. Breaking the sample function into two, one for each of these activities (PL/SQL exec and View read).
    All the combinations results in the same behaviour of 4M memory leak.
    Iam using Oracle 10g Client/Server 10.2.0.1.0.
    Is there any known limitations in this area?

    Yes. Iam closing the result set and terminating the statement.
    My program contains layers of inhouse wrapper classes, which will take some time for
    me to present it in pure OCCI calls, to be posted here for your understanding.
    After some more debugging, i found that if the connection level statement caching is set to
    0, the memory leak is much lower than before.
    Thanks.
    Message was edited by:
    user498920

  • Memory leak while debugging but not in release version

    I have an Adobe AIR application that must load and unload multiple external swfs, and it must run for hours.
    I had an issue where there was a memory leak. I tried all kinds of fixes, including rolling back SDKs and Adobe Runtime,
    but every time I tested in Flashbuilder, the memory would climb, and with each unload a FlexLoader would stay in memory.
    Finally I tried creating a release build, and low and behold the memory did not climb. It stayed the same even under stress testing.
    So evidently, the memory leak had to do with debug version, and once it was a release version, the leak disappeared.

    UPDATE: The problem was with the external swfs being loaded into the main application.
    If I compiled them in debug, they leaked. In release version they did not.

  • Memory Leak while using -Xrunhprof option in Linux OS

    While using the follwing option in my application there is memory leak in JVM in Linux OS.
    -Xrunhprof:heap=all,cpu=times,monitor=y,file=/home/gemini/dilip/www2.log,thread=yIs this a bug ??

    Little lost here. Looks like you are facing memory leaks in Tuxedo 7.1 WS
    client code when it talks with Tuxedo 6.x? Is this correct?
    If so, try installing latest rolling patch for Tuxedo 7.1.
    We recently fixed couple of memory leaks in interop area. One was related to
    compression.
    _shailesh
    Scott Orshan <[email protected]> wrote in message
    news:[email protected]..
    If you are running with the latest patch, then report these problems to
    Support, giving them sample code so that they can reproduce the problem.
    Scott
    Thomas Winter wrote:
    Hi Scott,
    as an additional information:
    The guys at the server side changed something (their
    formaly useing the old 6.3 libraries at server side)
    and surprise... the client has no memory leak anymore.
    But, if more than one thread at the same time use the atmi calls
    there is still some memory consumption.
    The workaround is to use a mutex object to make sure, that
    only one thread use the atmi calls.
    AFAIS Tuxedo has an Problem with Multithreading.
    Thx
    Thomas

  • HUGE memory leak when using MP3

    I downloaded a new FME 2.0 and noticed they added an option
    to stream in MP3 format. DO NOT USE that mode (!). If you start
    streaming in MP3 format you will get a huge memory leak on the
    client side. Your browser starts eating memory like crazy and it
    will bury your machine withing an hour or two by taking all the
    memory available. I have proved it on several machines, notifed
    Adobe. They confirmed it as a bug and promised to fix in the future
    releases. Nice, huh? and what people are supposed to do with the
    current build?

    A new build 2.0.1.1114 has been posted . Please try and let
    us know if you face this issue with this build.

  • Mountain Lion memory leak while asleep?

    My early 2011 MBP started to randomly crash after installing ML and Safari would take an age to load, endless spinning wheels, apps not opening etc etc. So did a Boot sector permissions verify and repair (2 very minor mismatched files) then a reset of PRAM and SMC which has cured the crashes and improved things from startup and removed old Sophos and installed new ML version.
    But the biggest problem is when waking from sleep. I have a memory tool in my status bar which usually shows anything between 3.5 - 5gb free RAM under normal conditions (I have 8gb installed) and that is what will be showing when I put it to sleep. When waking I get constant spinning wheels, the clock is frozen (spinning wheel will start from Time Capsule icon all the way to Spotlight) and the RAM tool is displaying 45mb or less of free RAM. It takes at least 5 minutes for RAM to creep back up to 150mb or so when things will then start to become usable. But at this point I won't even get an internet connection until I use the memory tool to fee up more RAM. I've read of other problems regarding wireless connectivity when waking up but I'm using an ethernet connection. Once everything has calmed down and memory settled down MBP works flawlessly with no crashing and all apps working fine and there is a speed improvement but I shouldn't have to wait up to 10 minutes for my MBP to be usable. I did notice that when launching Sys Prefs the Time Machine tab caused it to freeze so could this have something to do with that?
    But what could be bleeding off the RAM while it's asleep?
    I'm so ****** off at this, never a problem with SL and definitely wishing I'd waited before doing this upgrade, it reminds me of my Windows Vista days!!!

    Hello.
    In my Macbook Pro 4GB RAM recently note memory leak when I opened Safari even with 1 or two windows open without refresh the web content.
    In Activity monitor could see consume Web Content the Safari Spend more the 2 GB RAM (Memory Real become Memory Inactive)
    Solution: Disable All Extensions and probe one to one. Finding that Fastesttube Extension was responsible.
    Check this Info
    http://atylmo.wordpress.com/2011/06/...d-fastesttube/
    Best Regards

  • IPhone keeps going into recovery mode while playing mp3's through Ford SYNC

    Hi There,
    I have a 2008 Ford Focus with the SYNC iPod connectivity. I have the latest SYNC software update installed in my car.
    Twice now while playing songs via the USB connection with SYNC, my phone has suddenly dropped into recovery mode when it finishes playing a playlist.
    Can anyone offer a solution ? It is really annoying having to restore my phone all the time

    Ooops sorry about that. It must've been 8.1.2 then? I honestly don't remember.. I wasn't paying attention when I updated since I regularly do it for my iPad, other phones. Anyway, whatever is the latest version of the iOS, it got me stuck in recovery mode.
    really sorry about the 8.2 Info

  • Memory leak while appending uchar16 * to PMString

    Hi,
    I am using code like
    const uchar16 * TempWString ="Value";
    PMString str("");
    str.AppendW(TempWString);
    this. here I am getting memory leak at the line str.AppendW(TempWString);
    Can anyone help me out.
    Thanks,
    Amit.

    It's JDK1.3.0 that I am using, didn't try to run it on 1.4

  • 6280 - Quirks & Reboots while playing MP3

    MP3:
    I received an MP3 (it's a "chavie" version of a Gwen Stefani song) from a friend who has a Motorola. The MP3 plays fine on his phone, but every time I play it on mine, at around 8.5 seconds, the phone reboots. I forwarded it to a different friend with a Nokia (not sure of the model#) and it played fine. She forwarded it back to me, and alas, it still doesn't want to play ball...
    I have just played it back on my PC and at that exact point, I hear a blip in the audio. Nokia PC Suite just blanks for a split second at the point, but winamp makes a "digital noise" if that's the right term!
    QUIRKS:
    When the radio is on and keypad locked, pressing the "red" button turns the radio off... With my old 6610i you had to unlock then hold red.
    When the slider is open and the phone is locked, you HAVE to press Unlock then * to unlock it, I'm so used to pressing Unlock then OK (when the slider is closed)!
    There is no way of getting the very top line of the display (signal/battery/[G]/Bluetooth/Selected Profile/Locked - to wrap to a second line - there's no point having text there if you can't read it!
    Any suggestions?
    Thanks,
    AubsMessage Edited by aubs on 07-Mar-2006
    01:41 PM
    Aubs

    Sister,
    That could easilly be down to the physical size of the excel file (I often open HUGE files and my PC grinds to a halt) - In the majority of cases, Excel will carry on trying to open the file (a quick Ctrl+Alt+Del to bring up the Task Manager sould kill the unresponsive application) - unless it's Windows ME/98 or lower which aren't as stable as 2000 onwards.
    As you say there's nothing in the wild as yet, that doesn't mean there's nothing in the pipeline!
    Aubs
    Aubs

  • How to make the pic showed on ipod 5th while playing mp3

    can anyone teach me the way as captioned, very appreciate your help.

    Assuming you have artwork within iTunes, try this
    Open iTunes and select iPod in the iTunes Source list. Then click the Options button.
    Choose “Display album artwork on your iPod.”
    To see album artwork on your iPod:
    1 Play a song that has album artwork.
    2 From the Now Playing screen, press the Center button twice. If you don’t see artwork, either that song doesn’t have album artwork, or you need to set iTunes to allow iPod to display album artwork (see above).
    If you do not have art within iTunes, select the songs within iTunes library. Right click and then click on get info. This will give you an option to paste some art in. (You can copy art from Amazon)

  • Memory-leak playing rtsp:// media

    Hi all,
    We're finding that QT has a memory leak when playing rtsp:// media - it eventually causes an out-of-memory condition in our product (we're using QT embedded in a webpage, but see the exact same thing happening in FF/3.0.10, FF/2.0.0.20, IE/7.0.5730.11 & QuickTime Player) .
    We've tested with QT 7.62, 7.16 & 6.52 (all on WinXP Pro SP3) and they all have the same/similar leak. Playing this any example link (rtsp://video3.multicasttech.com/AFTVAdventure3GPP296.sdp) in QuickTime Player and monitoring it's memory usage (we used Sysinternals ProcessExplorer: http://download.sysinternals.com/Files/ProcessExplorer.zip) highlights the problem. Playing a similar file locally shows no leak.
    Please let me know if you need any more info...
    ChrisB

    Can you produce this webpage?
    No, it's part of an unreleased proprietary product, so I can't post the URL. If really necessary, I could pull the <embed> tag (actually generated with the standard Apple's "QT_WriteOBJECT" JS call) out and put it on a webpage on its own, but surely we can find one...
    I don't see and indication of a memory leak with QT based on using XP pro.
    Really? The three systems I tested on all had the same leak. We only see this leak with rstp:// URLs. Local playback does NOT induce this leak.
    The link you posted seems to be a direct download to some program
    It's a link to the program we used to monitor the web browser or QuickTime Player's memory usage over time. Please re-read my post:
    Playing this any example link (rtsp://video3.multicasttech.com
    /AFTVAdventure3GPP296.sdp) in QuickTime Player and monitoring
    it's memory usage (we used Sysinternals ProcessExplorer:
    http://download.sysinternals.com/Files/ProcessExplorer.zip)
    highlights the problem. Playing a similar file locally shows
    no leak.
    Cheers,
    ChrisB

  • Problem Report: Severe memory leak in Flash Player 9.0

    Summary
    Flash player 9.0 is prone to a severe memory leak when
    playing SWF files produced by Captivate 1 containing full-motion
    recordings.
    Versions affected
    The problem reproduces with Flash player 9.0 (Flash9.ocx,
    Version 9.0.16.0) hosted in either Internet Explorer 6.0 or Mozilla
    Firefox 1.5 on a Windows XP SP2 system.
    The problem does not reproduce with Flash player 8.0
    (Flash8.ocx, Version 8.0.22.0) in the same environment.
    Description
    After a few minutes playing a SWF file produced by Captivate
    1 containing a full-motion recording recorded with Captivate 1, the
    host browser ends up using more than a gigabyte of memory, and the
    playback of the movie slows down to a halt, together with
    responsiveness of the whole system.
    Impact
    Our organization develops E-learning content with Captivate 1
    for various customers, mostly Fortune 100 companies.
    This bug severely limits our ability to deliver content to
    our customers.
    Steps to reproduce
    1. Using Captivate 1.01.1418, create a “blank
    movie” with default settings.
    2. Use the “Record” button and begin recording a
    full-motion movie for about 2-4 minutes. For the purposes of this
    bug, it is enough to record a user typing random text in a Notepad
    window resized to fit in the default 800x600 window.
    3. After recording the full-motion movie, publish the
    Captivate movie as a “Flash (SWF)” movie, using default
    settings (making sure that the “export HTML” checkbox
    is selected).
    4. Open the published movie’s HTML file with a host
    browser, making sure that the browser is using the Flash 9.0
    player.
    5. While the movie is playing, watch the memory usage of the
    browser process using Windows Task Manager, and you will see that
    the values of the “Mem Usage” and “VM Size”
    counters keep increasing until the system becomes unusable.

    Also see:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=44&catid=184&threadid =1249396&enterthread=y
    Flash is generating around 300 page faults per second per
    flash animation
    Performance
    issues: page faulting
    Flash is also generating around 300 page faults per second.
    This can be observed by following the instructions in the link
    above for displaying page faults in the system task manager.

  • Memory leak in Tomcat 5.5

    Hi all, i am experiencing memory leaks while using tomcat 5.5 and mysql connector 3.1.7.. While running the attached code tomcat swallows up to 20 mb and doesnt return it. I close down everything but the app still leaks mem. For now it's not an issue (Tomcat stays below 60mb mem of 1gb), however running this app on serveral clients will dramatically increase the memory allocation.
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.awt.Image;
    import java.awt.Graphics2D;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import javax.swing.ImageIcon;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    public class Thumbs extends HttpServlet {
      private String dbDriver = "com.mysql.jdbc.Driver";
      private String dbURL = "jdbc:mysql://localhost/webapp?";
      private String userID = "javauser";
      private String passwd = "javadude";
      private Connection dbConnection;
      //Initialize global variables
      public void init() throws ServletException {
      //Process the HTTP Get request
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        try{
           String maxDim = "";
           String siteString = request.getParameterValues("s")[0];
           if (request.getParameterValues("d") != null){
               maxDim = request.getParameterValues("d")[0];
           if (maxDim == ""){
               response.setContentType("image/jpeg");
               OutputStream out = response.getOutputStream();
               writePicture(out,siteString);
           else{
               if (siteString != null) {
                   int maxDimension = Integer.parseInt(maxDim);
                   response.setContentType("image/jpeg");
                   OutputStream out = response.getOutputStream();
                   writeThumbnailPicture(out, siteString, maxDimension);
        } catch (Exception ex){
            ex.printStackTrace();
            log(ex.getMessage());
      public void writePicture(OutputStream out, String siteID){
          try{
              Class.forName(dbDriver);
              dbConnection = DriverManager.getConnection(dbURL, userID, passwd);
              PreparedStatement stmt = dbConnection.prepareStatement("select * from webcatalog where ID = ?");
              stmt.setString(1,siteID);
              stmt.executeQuery();
              ResultSet rs = stmt.getResultSet();
              if (rs.next()) {
                  byte[] data = rs.getBytes("Picture");
                  if (data != null) {
                      Image inImage = new ImageIcon(data).getImage();
                      BufferedImage outImage = new BufferedImage(inImage.getWidth(null),
                                                                 inImage.getHeight(null),
                                                                 BufferedImage.TYPE_INT_RGB);
                      // Paint image.
                      Graphics2D g2d = outImage.createGraphics();
                      g2d.drawImage(inImage,null,null);
                      // JPEG-encode the image
                      JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
                      encoder.encode(outImage);
                      out.close();
              rs.close();
              stmt.close();
              dbConnection.close();
          }catch(Exception ex){
              ex.printStackTrace();
      public void writeThumbnailPicture(OutputStream out,String siteID,int maxDimension){
        try{
          Class.forName(dbDriver);
          dbConnection = DriverManager.getConnection(dbURL, userID, passwd);
          PreparedStatement stmt = dbConnection.prepareStatement("select * from webcatalog where ID = ?");
          stmt.setString(1,siteID);
          stmt.executeQuery();
          ResultSet rs = stmt.getResultSet();
          if (rs.next()) {
            byte[] data = rs.getBytes("Picture");
            if (data != null) {
              Image inImage = new ImageIcon(data).getImage();
              // Determine the scale.
               double scale = (double)maxDimension / (double)inImage.getHeight(null);
               if (inImage.getWidth(null) > inImage.getHeight(null)) {
                   scale = (double)maxDimension /(double)inImage.getWidth(null);
               // Determine size of new image.
               // One of them should equal maxDim.
               int scaledW = (int)(scale*inImage.getWidth(null));
               int scaledH = (int)(scale*inImage.getHeight(null));
               // Create an image buffer in
               //which to paint on.
               BufferedImage outImage = new BufferedImage(scaledW, scaledH,
                   BufferedImage.TYPE_INT_RGB);
               // Set the scale.
               AffineTransform tx = new AffineTransform();
               // If the image is smaller than
               // the desired image size,
               // don't bother scaling.
               if (scale < 1.0d) {
                   tx.scale(scale, scale);
               // Paint image.
               Graphics2D g2d = outImage.createGraphics();
               g2d.drawImage(inImage, tx, null);
               g2d.dispose();
               // JPEG-encode the image
               JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
               encoder.encode(outImage);
               out.close();
          rs.close();
          stmt.close();
          dbConnection.close();
        catch(Exception ex){
          ex.printStackTrace();
      //Clean up resources
      public void destroy() {
      private void jbInit() throws Exception {
    }

    you can try this:
    open your connection outside the function, and then pass it like as a parameter...
    writePicture(OutputStream out, String siteID, Connection conn)
    this can solve the problem because opening the connection inside the function spends a lot of memory...
    Hope this can help you
    Regards
    Fernando

  • Memory leak in MAX Preview resolved by build 411

    I was experiencing a memory leak while using the TLF that came as part of Flex 4 MAX Preview. Over the course of several hours, instances of a class called TextAccImpl would rapidly accumulate to the point where they accounted for over 50% of memory usage in my application, severely degrading performance.
    Upgrading to weekly build 411 resolved this issue - I didn't try with build 409 to see if it was also affected.
    Posting this as I wasn't sure if this entry in the change notes; "Fix a memory leak issue with the TextLayoutFormat cache" was related or not.

    If you modify the code just to call theCon=scp->getConnection(); and scp->releaseConnection(theCon); in an infinite loop, in as many threads as you like but initially in just one thread, does this program's memory usage stabilise or does it continue to use increasingly more and more memory until it crashes due to lack of memory?

  • Memory leak on SunOne Web Server 6.1 on application reload

    Hi!
    I am pretty sure that i have found a memory management problem in
    SunOne Web Server 6.1 .
    It started with an OutOfMemory error we got under heavy load . After
    some profiling with Jprofiler i didn't find any memory leaks in the
    application.Even under heavy load (generated by myself) i can't find
    anything ,more, i can't reproduce the error! The memory usage is
    about 20Mb and does not go up .
    However it is pretty simple to see the following behavior:
    [1] Restart the server (to have a clear picture) and wait a little for
    memory usage to stabilize.
    [2] In the application dir. touch .reload or one of the classes:
    The memory usage goes up by another 50Mb (huge amount of mem. taking
    into account the fact that it used only 20Mb under any load befor).
    Do this another time and another 20Mb gone etc..
    The JProfiler marks the memory used by classes . And it can be
    clearly seen the GC can't release most of it.
    I AM sure this is not the application that takes all the memory.
    Another hint : after making the server to reload application i can see
    that the number of threads ON EVERY RELOAD is going up by ~10-20
    threads .The # of threads goes lower over time but not the mem usage.
    My system:
    Sparc Solaris 9 ,Java 1.4.2_04-b05, Sun ONE Web Server 6.1SP5
    Evgeny

    my guess is that - because of '.reload' , web container tries to
    recompile all the classes that you use within your web application and
    hence the memory growth is spiking up.What do you mean by "tries to recompile"?The classes in
    Web-inf are already compiled! And i have only ~5 jsp's .
    (the most part of the applic. is a complicated business logic)
    If you are talking about reloading them ,yes,that's the purpose of .reload,
    isn't it? :).But it seems that container uses the memory for it's own
    classes: the usage of memory for my classes don't really grow
    that much (if at all) after reload (according to profiler)
    Also the real problem is that the memory usage grows to much for
    too long (neither seen it going down) and thus ends with OutOfMemory.
    if you are seeing the memory growth to be flat in stress environment,
    then I am not sure that why do you think that there is a memory leak ?There is no memory leak in stress environment.
    There is memory leak while reloading the application.
    It is a memory hog for sure (~20-30Mb for every reload).
    Memory leak?It seems that way because i can't see memory usage go
    down and after a lot of reloads OutOfMemory is thrown.
    also, what is jvm heap that you use ? did you try jvm tune options like -
    XX:+AggressiveHeap ?256Mb.I can set it bigger ,but how do i know that it will not just delay
    the problem ?
    Thanks for response.
    Evgeny

Maybe you are looking for

  • Back to school card is not working

    Last week, I went to the apple store, Because my back to school card is not working. And the clerk helped me to solve that the problem. He said i will receive the mail from apple customer service. From last week until today. I did not receive any mai

  • Applescript: enclosing a picture in Mail so it is in the body of the text

    have a script on my server that sends mails using The Mail (Apple) Programme. It encloses a picture situated on the desktop (the script is larger, where it generates the picture and trashes it afterwards). Now the picture arrives as an enclosure and

  • DSL line drop problems

    I've had BT Broadband for about 2yrs with no problems,  then from the end of January I've had repeated line drops.  The HH recovers sometimes straight away, sometimes after 2 to 5 drops in quick succession.  each time the line speed is good but the c

  • How do you control when a Listbox updates the view?

    I have a problem, that when I highlight a line programmatically in a multicolumn listbox (wrting to the value property) it can take quite a while before you actually see it on the screen. I can work around it by disabling and again enabling the symbo

  • Increasing wireless range by upgrading airport card?

    I have had my powerbook G4 1.5 GHz for a little over 3 years and its been great for me except for its wireless range is somewhat lacking. When i have little or very limited connectivity people next to me with the new mac books have full reception. No