title: What is the best way to free up memory from a TypedArray in JavaScript?
body: <p>I understand fully that the garbage collector will eventually do it's job and free up the memory allocated in a <code>TypedArray</code> in exactly the same way as it would any variable or object (assuming there are no circular references etc).</p>
  
  <p>However, I am doing a lot of continuous processing in a number of <code>WebWorkers</code> and I would therefore like to have this memory freed as soon as possible by the GC.  Using normal <code>JavaScript</code> arrays, simply setting <code>array.length = 0;</code> is a good way a doing exactly this, but what about when using TypedArray's?</p>
  
  <p>Would the following result in the memory being freed as soon as possible?</p>
  
  <pre><code>var testArray = new Uint8Array(buffer);
  
  ///Do stuff with testArray
  
  tesArray.length = 0;
  </code></pre>
  
  <p>Or since the TypedArray is simply a view over the <code>ArrayBuffer</code>, would I need to clear the actual buffer itself also?  If so, how?</p>