Avoid memory leakage

Posted on 2011-04-27
Last Modified: 2012-08-14

I would like to know the measures to be taken to avoid memory leakage use as far as  less memory for our application.
I am developing air application so memory management is very important factor..
As per my knowledge to avoid memory leakage ...
1. Remove event listeners when not needed
2. Nullify the objects i.e variables etc in order to clean objects...
3. Avoid using array collection...

Is there any other factors to be taken care of...
Let me know so that the air application does not crash...

Also i have plans to store data(might be huge amt of data which grows periodically and accessible only through my application) in user any special measures to be taken

Question by:SreeramojuPradeep
    LVL 20

    Accepted Solution

    From my experiance here some more:

    4. In List/Tree-Based controls: Recycle wherever you can (If you use the itemRendererFunction property for example one item renderer instance is created for each item, If you use the itemRenderer property then flex/air creates and reuses only a few objects)
    5. Reuse data wherever you can. If you have a user list in several places of your application try to load the list only once instead of for each list.

    If you are really having problems, I'd suggest to utilize the Flash Builder Pro Memory Profiler (Think it's the only one available).
    LVL 29

    Expert Comment

    In Flash Player 10 I don't see problem with memory leakage.
    But always good practice to remove event listener(s) if not need it.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now