-

   eugene20237

 - e-mail

 
(0)

AS3

, 27 2012 . 17:06 +

:  
(0)

, 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. .


:  
(5)

, 06 2011 . 04:16 +
- "" , ))

"". , , ( ) . - ( ). , , . . wifi- - . , () - ?

, . , .. . , , . ? , , . - , .

! !
.

:  
(0)

AS3

, 05 2011 . 02:56 +
10 . -:
DICTIONARY[]: 155 ms
ARRAY[]: 196 ms
ArrayList::getItemIndex(): 19839 ms
VECTOR::indexOf(): 9923 ms

100 . -:
DICTIONARY[]: 1579 ms
ARRAY[]: 1473 ms
OBJECT[]: 1539 ms
OBJECT::hasOwnProperty(): 2029 ms

: indexOf(), .. -. ArrayList . Dictionary, Array Object . hasOwnProperty() .

:  

 : [1]