[IronPython] Python Memory Usage

Bernard Graham bernardgraham at gmail.com
Sat Jan 7 16:51:35 CET 2006


Hi there.

I am (like many) quite new to IronPython (and Python in general), but I am
trying to use it as a scripting language for a MUD system I am creating
(like the old text-based games, only multiplayer).

Now the scripts are executed and run very frequently (like when timers are
executed, or when players type commands, etc).

The problem I have is that after about an hour of serving, my windows system
goes out of virtual memory.  When I remove the references to IronPython and
don't execute any scripts, the memory stays stable.

I am sure I am using the IronPython engine incorrectly, so I thought that
maybe someone would be able to shed some light on this for me.

Here is the code I use to run a script (passed as a string to the c#
method):


pythonEngine = new PythonEngine();
if (parameters != null)
{
  //Pass "parameters" to the script that will be executed
  foreach (PythonParameter pp in parameters)
  {
    pythonEngine.SetVariable(pp.Name, pp.Value); //Variable name/variable
value
  }
}
pythonEngine.Execute(pythonScript);

This is executed everytime any script must be executed.

Please let me know if you can spot anything wrong with this...

Regards,

Bernard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060107/593ea61f/attachment.html>


More information about the Ironpython-users mailing list