title: How to free up memory on Array monitored by Angular2 change detection?
body: <p>For example I had a component contains a variable </p>
  
  <p><code>this.array = [];</code></p>
  
  <p>Then in the DOM I got a </p>
  
  <p><code>*ngFor="let el of array"</code> to loop displaying <code>Div</code>s on the DOM</p>
  
  <p>The array content changes dynamically from 3000 elements to another 3000 elements, frequently, and let the change detection render to DOM.</p>
  
  <p>Is this strategy to display dynamic data a good practice or is there any better way of saving memory usage?</p>
  
  <p><a href="https://i.stack.imgur.com/JinPF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JinPF.png" alt="enter image description here"></a></p>
  
  <p>Above picture showing the memory and call stack in three steps:</p>
  
  <p><code>before the array change script</code>
  <code>during array change script running</code>
  and
  <code>changes happen on the dom</code></p>