-

   eugene20237

 - e-mail

 


, 16 2012 . 06:35 +
Flash Player. 11.1 standalone debugger for win32. Flash Player , . , garbage collector (GC) . .

, GC ... , .. AS3. . : http://help.adobe.com/en_US/as3/mobile/flashplatform_optimizing_content.pdf
. , Flash Player , . .

Juick: http://juick.com/eugene20237@ya.ru/2009006 StackOverflow: http://stackoverflow.com/questions/11833009/as3-bitmapdata-memory-leaks
, , . .

. , . , BitmapData.

  • Loader . , BitmapData bitmapData.clone(), . Loader, loader.unload(). cacheAsBitmap=false.
    PHP:

    var bitmapData:BitmapData = (loader.contentLoaderInfo.content as Bitmap).bitmapData.clone();
    (
    loader.content as Bitmap).cacheAsBitmap false;
    (
    loader.content as Bitmap).bitmapData.dispose();
    (
    loader.content as Bitmap).bitmapData null;
    (
    loader.contentLoaderInfo.content as Bitmap).bitmapData null;
    loader.unload();
    font>


    . , . . ... Loader .

  • C Embed . ( 2 ) . Embed . , Flex-, . Loader. , Embded, Loader.loadBytes(...). .
    PHP:

    [Embed(source="../media/128.png"mimeType="application/octet-stream")]
    static private const 
    EmbedBMP:Class;
    ..............
    loader.loadBytes(new EmbedBMP() as ByteArrayAsset);
    font>



  • - . . ( 100 .) dispose(), , , : . ( 4096x4096), .

  • BitmapData BitmapData, . BitmapData.

  • , BitmapData - . . , , . , .

  • local connection. , LocalConnection try. , , . :
    PHP:

    public static function freeMemoryGC(): void
    {
      
    // the GC will perform a full mark/sweep on the second call.
      
    try
      {
        new 
    LocalConnection().connect('foo');
        new 
    LocalConnection().connect('foo');
        new 
    LocalConnection().connect('foo');
      }
      catch (
    e:*)
      {
      }
      
    //System.gc();
    }
    font>


    ( ). , 100 , . System.gc() AIR Flash Player. GC. .

:  

: [1] []
 

:
: 

: ( )

:

  URL