Hi,<div><br></div><div>I&#39;m running embedded IronPython scripts (2.6, .NET 3.5) and I was wondering what happens with the stuff allocated within the script after the script has finished? For testing purposes I&#39;ve been executing the following script</div>
<div><br></div><div><div>s = set()</div><div>for i in range(0, 1000000):</div><div>    s.add(i)</div></div><div><br></div><div>...and then watching the memory usage of the application. BTW I always shut down the scripting engine and create a new ScriptScope for each run.</div>
<div><br></div><div>I&#39;ve noticed that in the debug mode, the memory increases after each run. When I do a s.clear() before finishing, the increase is unnoticeable, so I assume those Python sets are kept alive (even if I do GC.Collect()).</div>
<div><br></div><div>I&#39;ve also tried running in the release mode and turning on the options[&quot;LightweightScopes&quot;] = true mode, which seems to help. But I cannot find any information about what this option actually does and what happens with the scope variables in general. Any info would be appreciated.</div>
<div><br></div><div>Thanks,</div><div>Igor Brejc</div>