Peter Bacon Darwin wrote:
> Additional info...
> If you move the scriptRuntime.CreateScope method outside the loop then
> there
> is no increase in memory.
But from my understanding of script scopes I need a new scope when using
local variables. I can have multiple scripts executing on different
threads with different local variables so as far as I'm aware creating a
new scope each time is the only way to allow that?
static void Main(string[] args)
{
ScriptRuntime scriptRuntime = IronRuby.CreateRuntime();
for (int index = 0; index < 1000; index++)
{
ScriptScope rubyScope = scriptRuntime.CreateScope("IronRuby");
rubyScope.SetVariable("local1", "hello");
rubyScope.SetVariable("local2", "world");
rubyScope.Execute("print \"#{local1} #{local2}\n\"");
}
Console.WriteLine("finished");
Console.ReadLine();
}
Regards,
Aaron
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core