Grant's FP8 memory leak find : Is it there in FP8.5? Confirmed.

Grant has posted his find of a memory leak in the FP8 player. Basically, when creating BitmapData objects within a function as a local, the BitmapData object is kept in memory, instead of being disposed off in full by the GC. I’m guessing that BitmapData .. data is stored in memort differently then normal objects, meaning the representation of the object is actually in the “normal” loop, but it’s actual graphical data is stored differently. A major issue indeed. It “enables” a Flash developer to get a huge pile-up of unused BitmapData … data.

I opened up Flex Builder 2, and “converted” grant’s example code to as3. Gues what? It’s there. Not very surprising, and not a big issue in an alpha, but definitly something which needs to be fixed. So nothing to worry about for the player team, but still a major issue in FP8. Flash Player Team? Help?


Here’s the “code”

package {
import flash.display.BitmapData;
import flash.display.MovieClip;
import flash.events.*;

public class KillMe extends MovieClip {

public function KillMe() {
addEventListener(EventType.ENTER_FRAME, enterFrame);
}

public function enterFrame(event:Event):Void {
var foo:BitmapData = new BitmapData(500,500,false,0×000000);
}
}
}

This entry was posted in Flash. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.