weblog . Biography . Flexibility . projects
  • photography by Kristel van Beek

    Flash Player memory differences per browser
    Buzzword, amazing...

    09 Nov: Garbage collection of the Flash Player

    posted by: martijn, at 9 November 2007 11:12 GMT+1, 7 January 2008 22:00 GMT+1

    I'm working on a project that loads 60 mb of images, there are 60 pages with an average of 1 mb of images. Loading all the pages is not an option because the memory of the clients computer would fillup. So I created a method that would unload pages 3 steps back and 3 steps forward and load the pages in between.
    You should think this would help but the memory keeps pilling up no matter what. Thanks to Flex Builder 3 and the profiling feature I could locate the problem. The page objects that should unload where not unloaded.

    The pages I'm loading are populated with classes for loading images/videos/text. These objects all contained a reference to the page object. When I unloaded the page object the most logic situation would be that the Flash Player would do some garbage collection and cleaned out the memory but that wasn't happening because of the reference to the page object (which took me some days to figure out).

    Adobe has a nice page about garbage collection here. The document has a chapter about "Mark sweeping" which explains the technique that should solve my problem but it doesn't.

    The image should explain it better. In the first situation you see an abstract structure of a swf, the red line referers to the object reference I talked earlier about.

    The second situation should be deleted with the "mark sweeping" method Adobe mentioned.

    The third situation is the solution for my problem, the reference is deleted and the garbage collector finally frees the memory as it should.

    Add this link to del.icio.us vote in HexoSearch permalink - tags: flash player - 2 Comments
    Write a comment for this article

    2 Comments

    • wenzhi li says:

      at 9 November, 2007 15:18 riameeting.cn
      The graph you drawed to demonstrate the secret of Flashplayer GC mechanism is Wonderful! thanks!
    • Kirill says:

      at 28 May, 2009 4:36 www.kirillam.com
      I'm doing some research on garbage collection in fp10 right now and stumbled upon your article. I'm in charge of architecting and developing an application framework which is used for very-large-scale projects our company does. One of the toughest things I found with flash is that when there's a problem involving the player itself usualy there's no information about it online and I'm left on my own to understand what's going. It's very rare that I find sensible articles about flash, because unfortunately smart people tend to avoid it. So I'm wondering if you'd be willing to keep a line of communication open for knowledge exchange. Please reply to my email address. Thanks!
    Write a comment for this article
  • categories
    • flash (26)
    • flex (26)
    • flash player (10)
    • php (7)
    • adobe (6)
    • eclipse (5)
    • weblog (5)
    • open source (4)
    • red5 (4)
    • mac (4)
    • linux (4)
    • apple (4)
    • style (4)
    • windows (3)
    • air (3)
    • apollo (3)
    • javascript (3)
    • design (3)
    • firefox (3)
    • flash media server (3)
    • uimodifier (2)
    • silverlight (2)
    • support (2)
    • microsoft (2)
    • bitmap limits (2)
    • internet explorer (2)
    • safari (1)
    • team (1)
    • chrome (1)
    • devigner (1)
    • git (1)
    • flex builder (1)
    • opera (1)
    • mxna (1)
    • google (1)
    • msn (1)
    • internet provider (1)
    • dell (1)
    • advertisement (1)
    • developer (1)
    • repent (1)
    • nintendo wii (1)
    • java (1)
    • music (1)
    show all
  • all articles
    • February, 2010
    • Flash on Mac Faster
    • December, 2009
    • Historic moment (somehow), Microsoft names Devigner in an article.
    • Universal filesystem
    • November, 2009
    • Projects get a home
    • October, 2009
    • I'm a daddy from now on, her name is Julia
    • My projects moved to GitHub
    • SWFLoader fails where Loader succeeds
    • September, 2009
    • Note to self: Ant Java heap space on Mac OS
    • August, 2009
    • Flash Player Bitmap Limits Again
    • May, 2009
    • Sloppy code
    • April, 2009
    • Flash CS4 IDE navigateToURL bug on the Mac
    • Flex Builder Gumbo expired
    • March, 2009
    • Dear Steve II: The files problem
    • Dear Steve I: The support problem
    • January, 2009
    • Flash Player Bitmap Limits
    • December, 2008
    • Google Chrome and why I use it for Flex debugging
    • November, 2008
    • UIModifier, release 0.0.1
    • October, 2008
    • AIR and Icons
    • Matrix rotation
    • September, 2008
    • CS4 announced, still huge price differences
    • Dear Adobe
    • Browser (technology) war
    • July, 2008
    • mx.effects.Move is Evil
    • Adobe, why no 64-bits Flash Player?
    • Collaboration with Adobe Flex
    • June, 2008
    • My vision on the web video future
    • Flex Builder rename bug (?)
    • May, 2008
    • Flash TextField bug?
    • Astro, Flash Player 10 prerelease has arrived
    • April, 2008
    • Released new website for Kristel van Beek
    • Portishead
    • March, 2008
    • IE7 + HTTPS + Flash
    • Mac experiences
    • I'm a mac now
    • February, 2008
    • AIR, my opinion!
    • Ubuntu living under Windows
    • Pulse, Eclipse on demand
    • January, 2008
    • Zend Neon becomes Zend Studio for Eclipse
    • BlueBerry needs Developers
    • Sparkling new website
    • December, 2007
    • Super Mario Galaxy
    • Apple, please deliver a 15" MacBook Pro with 1920x1200 resolution
    • November, 2007
    • Buzzword, amazing...
    • Garbage collection of the Flash Player
    • October, 2007
    • Flash Player memory differences per browser
    • Zend Neon
    • Flex Builder for Linux
    • September, 2007
    • Testing the existance of an attribute in XML with AS3
    • Opening Flash documents within Flex
    • PDT 1.0 Released
    • EU vs Microsoft
    • August, 2007
    • Repent has a brand new website
    • Manipulating XML with namespace in AS3
    • What's going on with MXNA?
    • Red5 Admin Panel's future
    • July, 2007
    • Red5 Admin Panel 0.2 release (update)
    • June, 2007
    • Red5 Admin Panel 0.1
    • BabbaVideo: A new dutch Video site
    • Safari on Windows
    • Adobe Flex 3 and AIR
    • Adobe Live 2007
    • May, 2007
    • Tommorow Adobe Live
    • Strange Windows bug
    • April, 2007
    • The dark side of Flash
    • March, 2007
    • BlueBerry needs a Flex Developer
    • Apollo server, hmm what is that
    • February, 2007
    • Why (especially Adobe) and other companies should support Linux
    • Flex/Eclipse plugin idea
    • January, 2007
    • PHPEclipse is out, welcome PDT
    • Linux Flash Player 9 released
    • I Welcome all you MXNA readers
    • FullScreen and wMode
    • FLV Player in Flex
    • December, 2006
    • Dell Support rocks
    • November, 2006
    • Flash Media Server 3, and more
    • October, 2006
    • XS4ALL trouble
    • BlueChat, Flash Media Server Application
    • September, 2006
    • Flex Google calender
    • Skinning v2 components
    • Flash Media Server Application and advanced skinning
    • August, 2006
    • I finally discovered JSFL
    • You know sIFR?
    • PHP IDE
    • Datagrid experiences
    • July, 2006
    • My weblog is born
    show all
All rights reserved | Design and Development by Martijn van Beek | Managed by Flexibility | Photography by Kristel van Beek

You have Flash Player version: (click to check if you got the latest)
Adobe feeds | LinkedIn profile | Last.fm profile | Github