title: How to free up the memory claimed by V8?
body: <p>An application I'm working on embeds <a href="http://code.google.com/p/v8/" rel="nofollow">V8</a> for scripting. To conserve memory, I want to shut down the scripting component when it is not needed, but for some reason the memory is never returned to the OS.</p>
  
  <p>Here's what I tried:</p>
  
  <p><strong>1. Call Dispose() on the persistent context handle</strong></p>
  
  <pre><code>context.Dispose();
  </code></pre>
  
  <p><strong>2. Force a garbage collection</strong></p>
  
  <pre><code>while (!v8::V8::IdleNotification());
  </code></pre>
  
  <p>None of that has any notable effect on the processes memory usage. I can clearly see how it's going up when a script claims memory, but it never goes down again.</p>
  
  <p>I'm determining process memory usage with <code>ps -o rss</code>. I know that figuring out how much memory a process is using is not really possible without a profiler, but I do believe rss should go down when V8 lets go of the memory.</p>