# Memory management and garbage collection?

**URL:** <https://forum.kirupa.com/t/memory-management-and-garbage-collection/311901>\
**Category:** Uncategorized\
**Created:** [July 20, 2010, 3:06am UTC](https://forum.kirupa.com/t/memory-management-and-garbage-collection/311901 "2010-07-20T03:06:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![norm](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@norm](https://forum.kirupa.com/u/norm)\
**Post date:** [July 20, 2010, 3:06am UTC](https://forum.kirupa.com/t/memory-management-and-garbage-collection/311901/1 "2010-07-20T03:06:30Z")

</div>

Hi,

I have a question here. In AS3, after I’ve removed a display object container B from another display object container A and deleted all the references to B in A, does that mean that all memories previously held in B will all be released too or do I have to manually delete all the references to objects in B before I can delete B in A in order to free all the memory space held?

One more question. I was kind of confused of when to use the delete statement and when to set a variable to null … Can I get any help for these?

??? ![](http://forum.kirupa.com/uploads/kirupa/6223/c5f9e21839f27346.gif)

Thx in advance and I look forward to hearing from you soon.
