# Strange memory allocation by ActionScript3

**URL:** <https://forum.kirupa.com/t/strange-memory-allocation-by-actionscript3/224000>\
**Category:** flash\
**Created:** [April 27, 2007, 12:50pm UTC](https://forum.kirupa.com/t/strange-memory-allocation-by-actionscript3/224000 "2007-04-27T12:50:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![awflasher](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/awflasher/32/3562_2.png) [@awflasher](https://forum.kirupa.com/u/awflasher)\
**Post date:** [April 27, 2007, 12:50pm UTC](https://forum.kirupa.com/t/strange-memory-allocation-by-actionscript3/224000/1 "2007-04-27T12:50:43Z")

</div>

I use system.totalMemory to listen the memory-allocation  
1)  
I made a button and when clicked the button it would new a Shape and call its graphics method to draw vector lines and then addChild. But it is strange that when I click it first and the lines are drawn, the memory difference is 0. Then another more click, 0 too, and the third one will bring a “0.00390625M”(I divided the number by 1024\*1024 to turn it to “M”) cost.

1. I add a mc to a dynamic class, as:

The output is  
8724480  
[object MovieClip]  
8728576  
undefined  
8728576

Why after adding a MC, the memory is even more !?  
and delete the MC did not make more…

It’s so strange that I don’t know what is wrong !  
Anyone talks about it ? Thanks in advance!
