[Ironruby-core] Memory Leak with Certain Script Exceptions

Curt Hagenlocher curth at microsoft.com
Sun Jul 6 21:03:26 EDT 2008

Are you continuously evaluating new bits of Ruby code?  Is each execution in its own ScriptScope?  In its own ScriptRuntime?

-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Aaron Clauson
Sent: Saturday, July 05, 2008 11:45 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Memory Leak with Certain Script Exceptions

Tomas Matousek wrote:
> What does the script look like?

Hi Tomas,

The Ruby script could be a single line such as:

sys.DoMethod(1, 2, 3)

Where sys is an object from a custom .Net class that has been loaded and
executed as:

ScriptRuntime scriptRuntime = IronRuby.CreateRuntime();
ScriptScope rubyScope = scriptRuntime.CreateScope("IronRuby");
DialPlanHelper helper = new DialPlanHelper();
rubyScope.SetVariable("sys", helper);
rubyScope.Execute("sys.DoMethod(1, 2, 3)");

If the DoMethod is called with the correct parameters it works fine,
however if the wrong number of arguments are provided a
System.ArgumentOutOfRangeException is thrown and the memory leak occurs.



Posted via http://www.ruby-forum.com/.
Ironruby-core mailing list
Ironruby-core at rubyforge.org

More information about the Ironruby-core mailing list