title: Creating many ScriptScopes in a remote AppDomain causing memory leak?
body: <p>I'm currently working with IronPython and for some reason when I try to create many ScriptScopes with variables in a separate AppDomain, my memory usage grows without ever GC'ing.  When I run this same code in the current AppDomain, garbage collection works fine and the memory never grows.  Below is a simple program to reproduce the OutOfMemoryException.</p>
  
  <p>I have also tested setting one large string variable instead of many variables and get the same result.  I'm running IronPython 2.7.4 on .NET version 4.5.50709, with my builds targeting x86 and .NET Framework 4.  Is there something special I need to do to release unused ScriptScopes in a separate AppDomain or is this a memory leak?</p>
  
  <pre><code>public static void Main()
  {
      var testLeak = true;
      var appDomain = testLeak ? AppDomain.CreateDomain("test") : AppDomain.CurrentDomain;
      var engine = Python.CreateEngine(
          appDomain, new Dictionary&lt;string, object&gt; { { "LightweightScopes", true } });
      var scriptSource = engine.CreateScriptSourceFromString("pass");
      var compiledCode = scriptSource.Compile();
      for (var i = 0; i &lt; 10000; i++)
      {
          var scope = engine.CreateScope();
          for (var j = 0; j &lt; 100000; j++)
          {
              scope.SetVariable("test" + j, j);
          }
  
          compiledCode.Execute(scope);
      }
  }
  </code></pre>