# Remove container VS remove all children

**URL:** <https://forum.kirupa.com/t/remove-container-vs-remove-all-children/324742>\
**Category:** Uncategorized\
**Created:** [September 6, 2011, 4:14pm UTC](https://forum.kirupa.com/t/remove-container-vs-remove-all-children/324742 "2011-09-06T16:14:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![McGrave](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@McGrave](https://forum.kirupa.com/u/McGrave)\
**Post date:** [September 6, 2011, 4:14pm UTC](https://forum.kirupa.com/t/remove-container-vs-remove-all-children/324742/1 "2011-09-06T16:14:57Z")

</div>

In my experiment memory usage keeps growing a little (more, and more RAM usage after GC) when I use repeatedly:

```auto
removeChild(picContainer);
addChild(picContainer);
picContainer.addChild(pic);

```

istead of

```auto
while(picContainer.numChildren){
picContainer.removeChildAt(0);
}
picContainer.addChild(pic);

```

Is that normal?  
Everything is fine when I use code with “while” loop
