What are some good memory management techniques in Flash / as3

So, I am well acquainted with memory management in Java, C and C ++; however, in flash, what designs exist for memory management? I assume that flash has a kind of virtual machine, such as java, and I assume that things get garbage collected when they are set to zero. I am not sure that this is true. Also, is there a way to force garbage collection in Flash? Any other tips?

thank

+3
source share
3 answers

- Flash AVM (ActionScript Virtual Machine). ( Java Flash Player), , , AVM JVM ( -, VM, AVM, , , JIT ..).

AVM, , , GC. , GC ( , ).

GC-, , , , google ( GC hack flash LocalConnection - ). GC .

, , GC deatil, AVM ++ ( , info, ). http://jpauclair.net/2009/12/23/tamarin-part-iii-current-garbage-collector-in-flash-10-0/

+3

: EventListeners . , AS/Flex , :

button.addEventListener(MouseEvent.CLICK, doSomething);

, : . , , , GC'd, , .

, :

button.addEventListener(MouseEvent.CLICK, doSomething, false, 0, true);

Adobe. , :

( ) . .

, , , EventListeners, , :

button.removeEventListener(MouseEvent.CLICK, doSomething);
+3

In addition to what has already been said, it is recommended to use a library, for example Mr Doob Actionscript Performance Monitor , which will activate the display of the current memory. Useful for detecting and fixing memory leaks.

0
source

Source: https://habr.com/ru/post/1740249/


All Articles