Fixing Memory Leaks in AIR App?

Hi Friends,
I'm been facing this memory leaks issue in our app and this has taken enough of our time and resources and we are not being able to find a solution for it.
I have identified the problem in the module where we primarily need memory related fixes which is - We are setting Repeater's recycleChildren() property to true/false based upon certain conditions which we cant change. Now when this property is set to false Repeater is supposed to be removing its last created objects from memory and creating fresh ones. In our case repeater is unable to delete those. When I managed to get their instances (using createdChildren()) and freed them in code I called System.gc() for releasing the memory back to OS. Now what is happening is that this approach works fine when I run the app from code but when I create its installer (from Installsheild) and formally out in on machines it does not work. I came to know the reason from following blogs:
http://jvalentino.blogspot.com/2009/05/flex-memory-issue-3-garbage-collection.html
http://gskinner.com/blog/archives/2006/06/as3_resource_ma.html
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/System.htm l#gc()
http://stackoverflow.com/questions/192373/force-garbage-collection-in-as3
http://gskinner.com/blog/archives/2006/08/as3_resource_ma_2.html
Guys, can anyone of you suggest what should I do here? This has become a delivery bottleneck and we need to give a fix where the memroy is released periodically and efficiently so that the end user's system does not hang.
Please help.
Shubhra

Are you sure it doesn't ? Maybe flash does release memory but the OS leaves it assigned as described in the below comment from http://www.mikechambers.com/blog/2008/08/06/what-are-your-biggest-issues-with-adobe-air/co mment-page-3/#comment-26330
"I just finished doing more experiments, I looks like the AIR app  does free the memory, but the OS leaves it assignned to the app process,  until other apps requiere that memory. So, looks like it is a natural  behaviour and the memory leak is not as terrible as I thougth."

Similar Messages

  • Image Memory Leaks in AIR app

    We are implementing an AIR application that loads thumbnails
    from the hard drive and uploads them to a remote server.
    When bringing in large images, for example, when importing
    five 2MB files into Image objects:
    Flex reports that it is using 55MB
    Windows reports using 220 Meg (viewing memory usage of
    adl.exe in task manager)
    After deletion of these image objects, the memory stays
    allocated!! It is released when the application is closed.
    Two issues I see:
    1. Huge memory usage for image objects (I understand that JPG
    files are exploded into BMPs). It limits our ability to load 10's
    or 100's of images.
    2. Bad Memory leak
    OTHER THINGS WE TRIED:
    1. Displaying images as inline html IMG tags.. Same memory
    usage!
    2. Taking a snapshot of the image and displaying that.
    Problem, used way to much CPU
    I hope these issues will be fixed before release time or we
    are hosed.
    PLATFORM: Windows XP Professional, service pack 2

    Hi
    Have you tried the FB3 profiler to investigate why memory is
    not getting deallocated?
    You can use the loitering objects panel to track the back
    references for the objects in memory. If you find that image object
    is not being referenced by anything else. Can you file a bug at
    http://bugs.adobe.com/flex
    with a small test case.
    Also as you know that jpg will be translated into bitmap. The
    amount of memory required will be determined by the pixels in the
    image. Each pixel will be 4K
    Thanks,
    Gaurav Jain
    Flex SDK Team

  • Memory Leak in Preview.app when switching Display Profiles

    I found a weird memory leak in Max OS X Preview.app, which manifests itself when Display profiles (color calbration) is change. I wonder if anyone else can reproduce my experience.
    1. Open up "System Preferences" -> "Displays", switch to the "Color" tab. You'll need at least 2 available profiles in the list. (If you only have 1, you can create another using "Calibrate..." button to launch Display Calibration Assistant.
    2. Open an image file in Preview.app.  The larger, the better. Zoom in full size to maximize the effect of the bug. I repro'ed easily with this image: http://www.donporter.net/NewSchool/Color/Examples/Printer%20Test%20file.jpg
    3. Open up "Activity Monitor.app", and click on Preview to highlight it, so you can watch its memory usage.
    4. Switch back to "Diplays" Preference Pane. Using the arrow keys, toggle up and down between two different Display profiles.
    4a. At the same time, watch Preview's "Real Mem" in Activity Monitor, as well as the total "Active" memory.
    5. Each time you switch profiles,  Preview consumes more Active/Real memory, about 25MB per switch in my case. This continues until all physical memory is consumed, and then (I presume) starts swapping virtual memory to disk.
    6. Bring Preview to  foreground, and all the profile-induced memory usage is freed.
    Weird, wild stuff.

    Could it be possible that this is just the OS holding the memory for the app until another process requires it?  Do you find that the memory increase eventually causes the app to become unstable? 
    It might be best to open a new bug report on this over at bugbase.adobe.com.  When adding the bug, please include any source code, project or installer that will help us reproduce the issue internally.  If you'd like to keep your code private, feel free to email it directly to [email protected]  Once entered, please post back with the URL so that others effected can add their comments and votes.
    Thanks,
    Chris

  • Can I locate "memory leaks" to keep apps from crashing?

    Hello clever people,
    Since the iPhone 4s is still on the market, I assume that my 2 year old 4s should be able to work fine. However, I am constantly plagued by apps crashing and, most frustratingly, apps often fail to remain running in the background, even with one or no other apps running.
    I had a similar issue with my iPad2, just before it ran out of applecare, and the chap had me run through with sending anaylitcs to him, and his conclusion was that a few apps were causing 'memory leaks' - had me reset the iPad and reinstall everything. So I also did this on the iPhone, which did help, but it has not solved the issue. I have also removed most apps from the device, in a bid to locate the offending app.
    Searching on Google for "memory leak" only brings up info for developers, and nothing for someone who is actually using their phone and having issues. My usual scenario is going for a bike ride and running Strava, which then cuts out when I stop to take a picture - with no other apps running.
    Does anyone know how to solve the issue - return the phone to its 'as new' state, or locate the problem and remove it?
    Cheers,
    Tobias

    There are differenty types of, "resets" ..
    Have you tried the folloiwng ??
    Reset the device:
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
    If that doesn't help, tap Settings > General > Reset > Reset All Settings
    No data is lost due to a reset.
    Use iTunes to restore your iOS device to factory settings

  • Memory leaks in the app

    While doing memory leak profiling in an application, I came across leaks due to certain custom methods like readHeaderBytes or httpProtocolStart from CFNetwork, GSEventRunModal from GraphicsServices etc. What should I do to correct these memory leaks???

    Find the objects that you are allocating that aren't being freed and call release on them. Check out this link:
    http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt. html

  • Fixing Memory leaks in C code accessed via JNI

    Hi,
    I am working on an JNI interface between Java and legacy C code and I have problems with controlling the Memory inside the C code. In my application, I call many times from Java the C routines. In the C routines, memory is allocated but in a rather unclear and sloppy
    way. Not all memory is return after the C code finishes and I cannot go inside the code and release the memory block using free(). As a consequence, after a couple of runs all memory is consumed. Nevertheless, I know that all memory allocated in the C program should be available again after the C routine has finished.
    Is there a trick available that, for example, I can release all claimed memory by the C program before returning to Java, so the next time a C routine is called from Java, all free memory is again available for the C routine?
    Perhaps unloading the DLL and reloading the DLL before each C routine (how to do?).
    Or keeping track of the memory pointer before entering the C code and force it back to that position (freeing the claimed memory) after finishing the C code part (how to do?).

    Presumably you know that the correct way is to fix the C code?
    Maybe or mabe not...thinking out loud here...(and you need to check everything I say, since I am not doing the research, just pulling it out of my head.)
    The only way to do what you want is to dig deep, deep into the OS and compiler.
    Each process on the OS allocates a stack and a heap (this is not the java heap) to the process when it starts.
    You could then take a snap shot of the heap before starting. Then on exit you would free anything that wasn't in use when you started.
    However, your java app uses the same heap, so if you have any threads then it won't work. But you always have more than one thread, for instance the garbage collector. You could of course hack the jvm source to suspend all the threads (C suspension not java) to solve that problem.
    But you can't make any java method calls in your C code without doing the snap shot thing again. And I would bet that comparing the post and pre snap shots is going to take a while.
    Alternatively I do know that dlls use (or maybe used to use) either their own heap or their own stack. If it is the heap then at least the time problem won't be as much.
    I think there is also a way to replace the heap. This might be easy or hard. And either way it is probably dangerous. But if you did that then you would never have to worry about the snap shot comparison. Just throw away the new heap when you are done (give it back to the OS.)
    You might want to really look at that C code to. C programmers tended to use global variables a lot and initialize them in routines like
    static void* mylocal =0;
    void doit() { if (!mylocal) mylocal = malloc(sizeof(something)); }
    And if that occurs anywhere then switching heaps or deleting snap shots is probably not going to work.

  • Memory leak running 32bit app in Windows 7 64bit

    I have an app that does not show signs of memory leakage (I'm queuing up 10mb arrays, and dequeuing them to file) under a standard 32bit operating system.  I've since tried running it in Windows 7 64 bit (as a 32 bit process using Labview 32-bit runtime engine) and noticed memory is incrementing.  
    Program takes 300Mb of memory.  If I save 100Mb of data to a file, will windows 7 64bit show this as 400Mb of memory (under windows on windows 32 bit)?  I don't think it would, but you never know...
    Are there any bugs in Labview 2010 with regards to queuing and windows 64 bit?  I'm tracking my Queue usage and it isn't increasing, thus no real reason for it to increase in memory allocation.
    Solved!
    Go to Solution.

    So this is something you observed.....by chance?
    Why is the memory "growth" a concern for you?
    As 32bit can allocate up to 2(3) GB of RAM per application process, memory is very limited, hence any application has to work very restrictive with memory.
    64-bit can allocate several TB of RAM (possibly reduced limited provided by the OS, but still more likely in the TB range rather than GB), an application doesn't need to be conservative.
    So it is possible that the OS Task Manager shows increased memory consuption, but as long as performance is not affected, it doesn't hurt anyone.
    Norbert
    EDIT: This might be also be induced by the funcions you are using to handle the data, in your case the file IO functions. Which functions are you using?
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Is there any memory leaks in the version 4.6.21?

    Hi All:
    My en so weak ,so I try my best to let you understand my mean...
    I add replication to my app rencently.
    It's seem any memory leaks in the version 4.6.21.
    Threr is an env in my app's database. and there are 2000 dbs in the env. The 2000 dbs distributing In 200 directory . And the 200 directory is the subdirectory under the DATADIR.
    In the app, client and master create all subdirectory befoer the env been opened . And In my test ,if the master app use relative path to create Db and r/w data, the data will be correct send to client, The data in the master and client will keep identical.
    But, There is many memory leaks in the app.In my test ,the app will use up all memory that lead malloc failed and crash.
    the app use DB_LOG_AUTOREMOVE,DB_LOG_INMEMORY,DB_REPMGR_ACKS_NONE.
    cache_size = 500M.
    void event_callback(DbEnv* dbenv, u_int32_t which, void *info)
         bool * isMaster = (bool *)dbenv->get_app_private();
         info = NULL;                    /* Currently unused. */
         switch (which) {
         case DB_EVENT_REP_MASTER:
              *isMaster = 1;
              dbenv->errx("switch to master mode");
              break;
         case DB_EVENT_REP_CLIENT:
              *isMaster = 0;
              dbenv->errx("switch to slaver mode");
              break;
         case DB_EVENT_REP_STARTUPDONE: /* FALLTHROUGH */
         case DB_EVENT_REP_NEWMASTER:
         case DB_EVENT_REP_PERM_FAILED:
              // I don't care about this one, for now.
              break;
         default:
              dbenv->errx("ignoring event %d", which);
    Thanks
    d.j
    Message was edited by:
    user623248

    I setup logdir,datadir and envdir into different directories with
    the functions set_data_dir and set_log_dir.I created two directories
    under the datadir and created more than 100 sub-directories
    respectively for the two dir, where the 2000 databases located.By the way, even though it doesn't seem likely to be the cause of the
    memory leak, you should still fix this illegal usage of subdirectories
    before we get much further investigating. We might as well eliminate
    any possible source of problem, no matter how unlikely it seems.
    Also, just as an experiment, I would be very tempted to try running
    again without using any separate directories. In other words, don't
    call set_data_dir or set_log_dir at all, and just let everything be
    put into the one single directory. If that changes the results, that
    will be a big clue to help us know where to look for the problem.
    I'am writting a demo , but it take time.
    i will reply later .Thank you. Take your time -- we'll be here.
    Alan Bram
    Oracle

  • Memory leak in string class

    We have developed our application in Solaris 10 environment. While running Purify on that it shows leak in the string class. This leak is incremental and so process size keeps in increasing. If we replace string with char array, the leaks disappears and process size also becomes stable.
    Following is the snapshot of the memory leak stack reported by Purify:
    MLK: 4505 bytes leaked in 85 blocks
    * This memory was allocated from:
    malloc [rtlib.o]
    operator new(unsigned) [libCrun.so.1]
    void*operator new(unsigned) [rtlib.o]
    __rwstd::__string_ref<char,std::char_traits<char>,std::allocator<char> >*std::basic_string<char,std::char_traits<char>,std::allocator<char> >::__getRep(unsigned,unsigned) [libCstd.so.1]
    char*std::basic_string<char,std::char_traits<char>,std::allocator<char> >::replace(unsigned,unsigned,const char*,unsigned,unsigned,unsigned) [libCstd.so.1]
    std::basic_string<char,std::char_traits<char>,std::allocator<char> >&std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator=(const char*) [libCstd.so.1]
    Has anyone faced this problem earlier or is there any patch available for this?

    Over time, we have found and fixed memory leaks in the C++ runtime libraries.
    Get the latest patches for the compiler you are using. (You didn't say which one.) You can find all patches here:
    [http://developers.sun.com/sunstudio/downloads/patches/index.jsp]
    Also get the latest Solaris patch for the C++ runtime libraries, listed on the same web page.
    If that doesn't fix the problem, please file a bug report at
    [http://bugs.sun.com]
    with a test case that can be compiled and run to demonstrate the problem.

  • Memory Leak in WindowsTreeUI?

    I'm hunting memory leaks in my app (of which there are alarmingly many), and have just stumbled across one which appears to be a bug in the class com.sun.java.swing.plaf.windows.WindowsTreeUI
    When the tree is populated, each treenode contains a reference to a node in our own rather large data structure.
    When we close the application-level model, we also call tree.setModel(null) and expect the tree to lose all its references. From a memory management point of view, it is important that the entire old model goes out of scope before we start loading a new one.
    If the tree is visible, everything works as expected.
    But if the tree is not visible (but still in scope) e.g. because we overlay a component in a JLayeredPanel, we get some dangling references in the (private) drawingCache member of the WindowsTreeUI class. And a single dangling reference keeps the whole caboodle in scope until something else comes along.
    I have a bad feeling I'm going to have code around painfully by substitiuting in some lite dummy model and then modifying all the event handlers that get confused as a result.
    Or does anyone have a bright idea how I can persuade the drawingCache to flush itself (presumably this only happens on windows)?
    Ian

    I also had a similar problem. My app has a number of large jtrees (200-300 nodes) with other data objects attached. I was doing a simple null of the JTree thinking that it would be GC'd. Using the NetBeans profiler I could see that it never went away. I found one location where I was temporarily hang on to node references within Swing controls. I've eliminated those. I then released the listeners I specifically assigned. There seems to be other listeners hanging on to node references. I have found little in the way of documentation or advice on how to clean these up. As a work around, when I'm done with a JTree, I traverse the nodes bottom up and remove each node from its parent (DefaultMutableTreeNode - removeNodeFromParent() ). This seems to work. The NetBeans profiler shows the vast majority of the JTree objects as GC'd. I'm sure this is not a perfect solution but it seems to be serviceable.
    I would appreciate hearing about any experiences in getting JTrees to GC.

  • Memory Leak - Oracle 9.2 ADO/OLE DB Select Distinct

    I'm using ADO (MDAC 2.8) and Oracle OLE DB (9.2.0.1.0) to access an Oracle 9.2.0.1.0 database. All queries run fine, but when I issue a query with the distinct keyword (e.g. Select distinct...), the application leaks memory. The memory leak does not occur when issuing the same query to MS SQL Server 2000. I also installed the latest 9.2.0.2.0 Oracle OLE DB update, but it didn't fix the problem.
    The same problem appears to have been fixed with Oracle ODBC drivers. "Fixed memory leak when using �select distinct�. (Bug2685365)"
    http://otn.oracle.com/software/tech/windows/odbc/htdocs/whatsnew.htm
    I've also seen the same problem reported on DBForums.com.
    "...select distinct query made through ADO causes a memory leak in that object... This issue is known by Oracle and I think that there may be a patch available for Oracle 9."
    http://dbforums.com/arch/210/2003/3/733498
    This is a critical problem for the product we are developing.
    Is there a fix available for this problem?
    Bob

    Thanks, I looked for the update yesterday, but all Oracle had posted was the update for 9.2.0.2.0.
    Luckily, as of this morning there is a new update available from Oracle, 9.2.0.4.0. I installed it and it fixed the memory leak with OLE DB and Select Distinct queries.
    The installer for 9.2.0.4.0 is a bit rough. It doesn't stop the Distributed Transaction Coordinator or Oracle MT Service on your computer, so you must stop them before installing. Also, you can't install all the products at once and must install the Oracle uninstaller first.

  • Memory leak when pushView an popView

    Hello to community!
    I am having problems of memory leaks with an app I had build. After using it for 30-40 min it begin to go slow and slow.
    The app show images as a catalog, but when I push and pop the views my memory rise a lot.
    I think I am deleting all my oibjects setting them to to null and disposing all de bitmapdata that I use so I think that the problem should not be there.
    I have 3 views in my app menuView.mxml,categoriesView.mxml and productsView.mxml.
    My App begin in my pc (not in tablet) with TotalMemory: 47Mb and Private Memory : 88 MB
    After pushing and poping the views for 5 times I get TotalMemory: 61Mb and Private Memory : 101 MB
    Imagine if I do this for 20 times, all the app begin to go very slow in my Ipad or my Samsung Galaxy Tab.
    Why is this happening? I have no idea how to solve this.
    Thanks a lot!!
    I put some code below.
    Whe I am in menuView i use the following code to push the view from menuView to categoriesView
    protected function button3_clickHandler(event:MouseEvent):void
                    if((FlexGlobals.topLevelApplication.getIdClienteServidorCompraActual()!=null)&&(FlexGloba ls.topLevelApplication.getIdClienteServidorCompraActual()>0))
                        navigator.pushView(categoriesView);
    Whe I am in categoriesView i use the following code to push the view from categoriesView to productsView. In this view i have 3 button for each category.
    protected function buttonC1_clickHandler(event:MouseEvent):void
                    //Categoria general con todos
                    var ab:ArrayCollection =  getIdAmbienteServidor();
                    cleanMemory();
                    navigator.pushView(productsView, null);
    private function cleanMemory():void
                    result.splice(0);
                    result = null;
                    System.gc();
    Whe I am in productsView I use the following code to pop(I USE PUSH INSTEAD OF POP DUE TO DIFFERENT OPTIONS I HAVE) the view from productsView to categoriesView .
    protected function button1_clickHandler(event:MouseEvent):void
                    cleanMemory();               
                    navigator.pushView(menuView);        
    private function cleanMemory():void
                    if(image1 != null)
                        image1.source = "";
                        if(image1.bitmapData != null)
                            image1.bitmapData.dispose();
                    if(image2 != null)
                        image2.source = "";
                        if(image2.bitmapData != null)
                            image2.bitmapData.dispose();
                    if(result != null)
                        result.splice(0);
                        result = null;
                    if(result1 != null)
                        result1.splice(0);
                        result1 = null;
                    if(result2 != null)
                        result2.splice(0);
                        result2 = null;
                    dbConnection = null;
                    object1 = null;
                    object2 = null;
                    dataToSave = null;
                    cGreyImageSmallAsset = null;
                    cRedImageSmallAsset.bitmapData.dispose();
                    cRedImageSmallAsset = null;
                    cOrangeImageAsset.bitmapData.dispose();
                    cOrangeImageAsset = null;
                    cGreenImageAsset.bitmapData.dispose();
                    cGreenImageAsset = null;
                    cPinkImageAsset.bitmapData.dispose();
                    cPinkImageAsset = null;
                    cBlueImageAsset.bitmapData.dispose();
                    cBlueImageAsset = null;
                    cGreyImageAsset.bitmapData.dispose();
                    cGreyImageAsset = null;
                    cRedImageAsset.bitmapData.dispose();
                    cRedImageAsset = null;
                    cGreenImageSmall = null;
                    cOrangeImageSmall = null;
                    cPinkImageSmall = null;
                    cBlueImageSmall = null;
                    cGreyImageSmall = null;
                    cRedImageSmall= null;
                    cGreenImage = null;
                    cPinkImage = null;
                    cBlueImage= null;
                    cGreyImage = null;
                    cRedImage= null;
                    cOrangeImage= null;
                    System.gc();
    I load the images with.
    private function setImages():void
                    //var width:Number = FlexGlobals.topLevelApplication.width;
                    if(object1!=null)
                        //var widthImage1:Number = (width/2)-80;
                        //image1.width = widthImage1;
                        panelLeft.visible = true;
                        buttonLeftMore.visible = true;
                        image1.source = "file://" + File.applicationStorageDirectory.nativePath + "/b"+object1.idArchivo+"_500.jpg";
                        setObject1MainTexts();
                    else
                        image1.source = "";
                        panelLeft.visible = false;
                        buttonLeftMore.visible = false;
                    if(object2!=null)
                        //var widthImage2:Number = (width/2)-80;
                        //image2.width = widthImage2;
                        panelRight.visible = true;
                        buttonRightMore.visible = true;
                        image2.source = "file://" + File.applicationStorageDirectory.nativePath + "/b"+object2.idArchivo+"_500.jpg";
                        setObject2MainTexts();
                    else
                        image2.source = "";
                        panelRight.visible = false;
                        buttonRightMore.visible = false;
    Whe I am in categoriesView i use the following code to pop(I USE PUSH INSTEAD OF POP DUE TO DIFFERENT OPTIONS I HAVE) the view from categoriesView to menuView.
    protected function button1_clickHandler(event:MouseEvent):void
                    cleanMemory();
                    navigator.pushView(menuView);
    private function cleanMemory():void
                    result.splice(0);
                    result = null;
                    System.gc();

    Hello,
    I've the similar problem. I try to clean all objects, listeners and images. But i still have a memory leak.
    Do you found a solution, Richard ?
    Regards.

  • Getting rid of  JFrame (big memory leak)

    Hi,
    I have an app that has a main frame with a button. When you press the button another JFrame is created. When you close this JFrame it is not garbage collected becauses references to it are held by some swing internals and also, it appears, by all listeners that have been registered. Is there any way of getting rid of these references so I can recover the memory? This is causing a huge memory leak and the app eventually dies......
    Thanks
    Simon

    Don't know if you are using kunststoff laf and a 1.4 jvm, but kunststoff has a mem leak when using toolbars.
    I sent a mail in August 2002 to them, but it seems no bugfix release is coming out.
    Copy of the relevant part of the mail:
    While looking for a memory leak (JFrames not being garbage collected), I noticed a bug in the kunststoff 2.0.1 laf:
    The KunststoffToolBarUI class is a singleton, but the base MetalToolBarUI class is not (at least in jdk 1.4, I haven't looked at earlier versions).
    The MetalToolBarUI has several hashtables containing ui components, and the static reference in KunststoffToolBarUI is preventing the components in this hashtables from being garbage collected.
    After changing KunststoffToolBarUI.createUi to always return a new instance of KunststoffToolBarUI the memory leak disappears and the JFrame's are garbage collected.

  • AIR runtime Memory Leak?

    Hi,
    I have an app developed with AIR 3.7 for iOS (iPad)
    The app gets very sluggish after a while, eventually crashes.
    I've been -very- careful to pool objects where possible and cleanup / nullify all objects once they're not needed any more.
    Profiling the app in Scout returns a pretty stable memory profile (the peaks and the lows translate very well to what's happening on screen)
    Simultenously profiling the app using XCode's Instruments, shows me that the memory consumption off the app constantly rises up to the point the systems spends more time throwing memory warning than anything else.
    Here are screenshots of both profilers: they show as3 memory usage being pretty stable, on the app level, memory keeps rising...
    https://dl.dropboxusercontent.com/u/608333/AIR_memory_leak.zip
    If AS3 is not leaking any memory (according to scout), but the app is (according to Instruments), would I be right assuming there's a memory leak in the AIR-runtime itself?
    thanks for your feedback!
    bart.

    ok, lots of trial and error has showed me the following:
    There are two issues when loading assets using the Loader Class with its LoaderContext set to ImageDecodingPolicy.ON_LOAD.
    These issues typically arise in a magazine-like app, where many images are loaded and unloaded continously.
    Issue 1:
    When initializing a load() on a Loader class with LoaderContext to ImageDecodingPolicy.ON_LOAD, all image decoding seems to be queued in a seperate thread. With several large images, especially on mobile devices, the time to crunch through a queue like this can easily go into dozens of seconds. During that time, some of the loaders can be unloaded, cleared, nulled and deleted. Yet, the loader isn't removed from the decoding queue.
    In other words: once you fire the 'load' method on a Loader instance, you're not able to cancel the decompression process, even though the decompression might not even have started yet, as queued by other decompressions.
    Issue 2:
    When a Loader instance is unloaded, cleared, nulled and deleted while its decompression is still queued and not yet fully decompressed, there seems to be a memory leak. With several dozens of images loading and interupting the loading, you'll notice a difference in memory consumtion when comparing memory output in Scout and in Instruments. Both memory graphs build up very similar yet after the runtime's garbarge collection kicks in, the memory graph in Instruments seems to not release memory fully. Consumption gradually rises until the app eventually crashes.
    https://dl.dropboxusercontent.com/u/608333/AIRMemoryLeakExample.zip
    This example app allows you to create loaders in bursts by touching the screen.
    You'll instantly see the massive waiting times for decompression, despite the fact there's only a few Loader instances in memory at the same time. After several short bursts and wait-a-bit-for-decompression-to-catch-up, you should also notice the difference in memory profiling between Scout and Instruments.
    I managed to work around both issues by making a LoaderQueueManager class.
    This class instantiates and returns a Loader instance, queues these instances and tracks its onComplete handler. Only when one loader is finished loading, the next loader starts loading. This way, you never have different instances trying to simulataneously decompress their content. As such decompressions are never interrupted and loaders can also be de-queued. This practically speeds up decompression dramatically, since images that are removed won't get decompressed in vain. Memory Leaks also don't occur, since not a single decompression is ever interupted.
    This solution only works with content loaded locally.
    Hope you can get somewhere with this,
    and hopefully, you find a fix in one of the next AIR releases.
    best,
    bart.

  • How to fix huge iTunes memory leak in 64-bit Windows 7?

    iTunes likes to allocate as much as 1.6GB of memory on my dual-quad XEON 8GB 64-Bit Windows computer and then becomes unresponsive.
    This can happen several times a day and has been going on for as long as I can remember.  No other software that I use does this - only Apple's iTunes.  Each version I have installed of iTunes appears to have this same memory leak.  Currently I am running version 10.7.0.21.
    I love iTunes when it works.  But having to constantly kill and relaunch the app throughout the day is bringing me down.
    Searching for a fix for this on the internet just surfaces more and more complaints about this problem - but without a solution.
    Having written shrinkwrapped software for end users as well as for large corporations and governments for more than 25 years I know a thing or two about software.  A leak like this should take no more than a day or two to locate using modern software tools and double that to fix it.  So why with each new version of iTunes does this problem persist?  iTunes for Windows is the flagship software product Apple makes for non-Mac users - yet they continue to pass up each opportunity they have had over the years with each new release to fix this issue.  Why is this?
    Either the software engineers are not that good or they have been told NOT to spend time on this issue.  I personally believe that the engineers at Apple are very good, and therefore am left thinking that the latter is more likely the case.  Maybe this is to coax people to purchase a Mac so that they can finally run iTunes without these egregious memory leaks.  I would like to offer another issue to consider.
    Just as Amazon sold Kindles and Google sold Nexus tablets at low cost - not counting on margin for profit - but instead they wanted to saturate the marketplace with tools for making future purchases of content almost trivial to do with their devices.  Apple also counts on this model with their pricer hardware - but they also have iTunes.  Instead of trying to get people to switch to a MAC by continuing to avoid fixing this glaring issue in iTunes for Windows I would like to suggest that by allowing their engineers to address this issue that Apple will help keep Windows users from jumping ship to another music app.  The profit to be made by keeping those Windows users happy and wedded to the iTunes store is obvious.
    By continuing to keep this leak in iTunes for Windows all it does is lower my esteem for the company and start to make me wonder if the software is just as buggy on Macs.

    I have same issue. Ongoing for more than 1 year and currently running iTunes 11.3.
    My PC is Dell OptiPlex 990 I7 processor, 8GB ram, W7 64 [always keep things patched up to latest OS updates etc]
    I use this iTunes install to stream music videos etc to multiple appleTVs, ipads, iphones etc .. via Home Sharing
    Store all my media including music, videos and apps on separate NAS  .. so the iTunes running on PC is only doing the traffic cop role and streaming / using files stored on NAS .. creates lots of IO across my network
    Previous troubleshooting suggest possible contributing causes include
    a) podcast updates  .. until recently I had this auto updates on multiple podcast subscriptions, presumably the iTunes would flow this from the PC to save on the NAS across the network .. if the memory leak is in the iTunes network communication layer (?bonjour?)  this may be sensitive to IO that would not normally occur if the iTunes file saving was local on the same PC
    b) app updates .. have 200+ apps in my library and there is always a batch of updates .. some updates 100s of MB is size .. routinely see 500MB to 1GB of updates in single update run .. all my apps are
    c) streaming music / movies .. seems when we ramp up streamlining of music or movies . memory leak grows faster .. ie within hours of clean start
    c) large syncs of music or videos to ipads or iphones .. noticed that get big problems when I rebuild an ipad .. I typically have 60+ GB of data in terms of apps /  music / videos to load .. have to do rebuild in phases due to periodic lockups

Maybe you are looking for

  • Can anyone explain why my internet is slowing down...

    I noticed today my router had reset in the night and dropped speed, ive had a bad time with speed since getting BT infinity and finally it was at the 70mb i was suppost to get. Until i woke up today its slowly going down.  Heres some stats to see wha

  • MacPro does not react to Clear RAM Preview

    In order to see the movie fluently I make a RAM Preview. That works fine. But I cannot erase the RAM-Preview. Only after restart of motion, the RAM is free again. When I check with "istat pro"-Widget, I can see that the RAM is full and clicking on "c

  • How to Insert and call custom Code in CaptivateMainTimeine.as?

    I have been trying to get my head around this, using various blog postings by Jim Leichliter as my guide. However, so far I have been defeated. This is what I attempted (in Captivate 5): 1) I inserted the following code into CaptivateMaintimeline.as,

  • Hover over hotspot - image popup? How to?

    Hi, new to HTML and CSS - really no code to post, anything I try doesn't work in the slightest. I'm trying to have an image popup directly below a hotspot on mouseover of that hotspot. I can get it to work on text, but not with the hotspot. Either do

  • Captivate 5 in Smartbuilder - Scroll Bars

    I imported Captivate 5 into a Smartbuilber page and there are scroll bars. Smartbuilder said I had to change the size of the Captivate file. How do I do this?