Re: [IronPython] Debugging support PythonEngine

2006-08-11 Thread Kristof Wagemans








Are there plans to improve the debugging experience
in the future or are you at a point where it is as good as it gets?
Being able to debug makes writing and using python scripts a lot easier.



Inside functions I can see not only the
function parameters but also the newly defined local variables. Are these
different from the global variables? I would have expected that the function
locals are also stored inside a dictionary.



Is it possible to step into python
functions without getting into assembly instructions? This is very frustrating
and degrades the debugging experience a lot. This is the more important issue
for me. Im not going to be using global variables frequently, but mostly
functions loaded in the PythonEngine that are called from C#.











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shri Borde
Sent: Friday 11 August 2006 0:30
To: Discussion
 of IronPython
Cc: Glenn Hackney
Subject: Re: [IronPython]
Debugging support PythonEngine





If EngineOptions.ClrDebuggingEnabled
is set, we use AssemblyBuilder, TypeBuilder, etc for PythonEngine.Executed. The
code generated by AssemblyBuilder, TypeBuilder, etc supports PDB debug
information tracking for the methods, and so you will be able to set
breakpoints in the code. However, it does not guarantee a perfect debugging
experience. PythonEngine.ExecuteFile will use a dictionary for storing global
variables, and these will not be visible because VS does not know about the
dictionary. If you use PythonEngine.CreateOptimizedModule, most global
variables are implemented using CLR statics, and so VS may be able to display
them for you. Global variables added using an exec statement will still not be
visible.



If EngineOptions.ClrDebuggingEnabled
is false, we will use System.Reflection.Emit.DynamicMethod. This does not
support debug information tracking at all, and you will not even be able to see
function variables.



So If EngineOptions.ClrDebuggingEnabled
is will improve your debugging experience, but it wont give you a perfect
experience.





 

Do
you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kristof Wagemans
Sent: Thursday, August 10, 2006
2:10 PM
To: Discussion
 of IronPython
Subject: [IronPython] Debugging
support PythonEngine







I have been experimenting with the debugging support for the
PythonEngine. When I use the following code I have several problems.



PythonEngine _pe;

EngineOptions options = new EngineOptions();

options.ClrDebuggingEnabled = true;

_pe = new PythonEngine(options);

_pe.ExecuteFile(@ script );



Test script:



x = 1

y = 2



def Add(a, b):

 return a + b



z = Add(x, y)

print z





I opened the script file in Visual Studio and placed a
breakpoint at the beginning of the file. The application runs and breaks at the
correct location. Stepping through the lines works, but I cannot see any values
of the global variables.

When I try to step into the function I get a notification
that there is no source code available and I must show the disassembly. After I
step several times through the assembly instructions I can return to the
original source code. Inside the function I can see the values of the function
variables.

I have tried debugging ipy.exe with the script and there I
can see the global variables, but I still have the problem with stepping into a
function. In ipy.exe the script file is executed in a different way. Using the
same method I can also see the global variables with my PythonEngine instance.
I apparently dont need to set ClrDebuggingEnabled in this case.



PythonEngine _pe;

_pe = new PythonEngine();

OptimizedEngineModule engineModule =
_pe.CreateOptimizedModule(@ script ,
__main__, true);

engineModule.Execute();



Are you required to use an OptimizedEngineModule to be able
to debug completely? Am I forgetting some settings for debugging? Can I step
directly into a function without getting into the assembly instructions?








___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] PythonEngine.RunFile

2006-08-11 Thread Tim Riley
Thank you both. I will give that a shot.On 8/10/06, Shri Borde [EMAIL PROTECTED] wrote:













__name___ == __main__: is a convention
enforced by ipy.exe. The PythonEngine itself does not directly support this
concept. However, you can achieve that result (just like ipy.exe does) by using
code like this:



PythonEngine engine = new PythonEngine();

EngineModule module = engine.CreateModule("__main__",
false);

engine.ExecuteFile(filename, module);





 


Do
you want to help develop Dynamic languages on CLR? (
http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)







From:
[EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED]] On
Behalf Of Martin Maly
Sent: Thursday, August 10, 2006 3:06 PM
To: Discussion of IronPython
Subject: Re: [IronPython] PythonEngine.RunFile







You can try the PythonEngine.CreateOptimizedModule which you can
also pass a name your module should get. Let us know if that doesn't meet
your needs.



Martin





From:
[EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED]] On
Behalf Of Tim Riley
Sent: Thursday, August 10, 2006 2:17 PM
To: Discussion of IronPython
Subject: Re: [IronPython] PythonEngine.RunFile





I've tested that and I don't
think it works with:

if __name___ == __main__:

in the python script.

Regards,
Tim Riley



On 8/10/06, Martin Maly [EMAIL PROTECTED]
wrote:







Think
PythonEngine.ExecuteFile may work for you.





From: [EMAIL PROTECTED]

[mailto:
[EMAIL PROTECTED]] On Behalf Of Tim Riley
Sent: Thursday, August 10, 2006 1:01 PM
To: Discussion of IronPython
Subject: [IronPython] PythonEngine.RunFile









In IP version 0.9 there was a PythonEngine.RunFile() method, this seems to
be gone in 1.0.6. Is there a replacement? 








___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com











___users mailing listusers@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Embedded IP eating memory

2006-08-11 Thread Rodolfo Conde





 Hi

 I have an IP-Embedded 
C#application (IP version IronPython 1.0.60523 (Beta) on .NET 
2.0.50727.42, Yeah i know, im out of date, but i havent make the change to 
latest version because i saw there weresome API changes :) ), i create one 
PyEngine, set some global variablesand inside a while block iexecute 
this little script every time:

import sys

try:i = 
sys.path.index("scripts")except:sys.path.append("scripts")

import CMOpFuncionalidad

try:pyop = CMOpFuncionalidad.PyOperador(cmop, dba, 
connID)pyop.atiendeCM()pyop.liberaRecursosBD()pyop 
= Noneexcept:pyop.liberaRecursosBD()pyop = 
Noneraise

The module CMOpFuncionaliad is an IPython script i wrote, it contains a 
class definition. Inside the scripts i use components defined in some assemblies 
i made (these are already loaded into the CLR). The problem is,after the 
Engine takes the usual 12M+- of memory it needs, every time the script executes 
it consumes 2M more, i dont have a clue why is this...Does this version of IP 
have memory problems ? Or what else could be ?? If you need to see 
CMOpFuncionalidad.py let me know and ill send it

 
 Thanks for your help

 Greetings...

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Debugging support PythonEngine

2006-08-11 Thread Shri Borde








Yes, we will definitely be working on improving the debugging
support as it is a critical part of the development process. However, full
support will need work in all parts of the tool chain including VS.



Python local variables are implemented as normal MSIL variables
(except in cases like closures). Hence, VS is able to display them.



Currently, the best way to debug Python functions in VS while
using PythonEngine would be to enable EngineOptions.ClrDebuggingEnable, open
the PY file in VS and put a breakpoint where you want. Stepping in and out of
Python functions will step you through methods in IronPython.dll .







From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kristof
Wagemans
Sent: Friday, August 11, 2006 12:36 AM
To: 'Discussion of IronPython'
Subject: Re: [IronPython] Debugging support PythonEngine







Are there plans to improve the
debugging experience in the future or are you at a point where it is as
good as it gets? Being able to debug makes writing and using python
scripts a lot easier.

Inside functions I can see not
only the function parameters but also the newly defined local variables. Are
these different from the global variables? I would have expected that the
function locals are also stored inside a dictionary.

Is it possible to step into python functions without getting into
assembly instructions? This is very frustrating and degrades the debugging
experience a lot. This is the more important issue for me. Im not going
to be using global variables frequently, but mostly functions loaded in the
PythonEngine that are called from C#.











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Shri Borde
Sent: Friday 11 August 2006 0:30
To: Discussion of IronPython
Cc: Glenn Hackney
Subject: Re: [IronPython] Debugging support PythonEngine





If EngineOptions.ClrDebuggingEnabled is set, we use
AssemblyBuilder, TypeBuilder, etc for PythonEngine.Executed. The code generated
by AssemblyBuilder, TypeBuilder, etc supports PDB debug information tracking
for the methods, and so you will be able to set breakpoints in the code.
However, it does not guarantee a perfect debugging experience.
PythonEngine.ExecuteFile will use a dictionary for storing global variables,
and these will not be visible because VS does not know about the dictionary. If
you use PythonEngine.CreateOptimizedModule, most global variables are
implemented using CLR statics, and so VS may be able to display them for you.
Global variables added using an exec statement will still not be visible.



If EngineOptions.ClrDebuggingEnabled is false, we will use
System.Reflection.Emit.DynamicMethod. This does not support debug information
tracking at all, and you will not even be able to see function variables.



So
If EngineOptions.ClrDebuggingEnabled is will improve your
debugging experience, but it wont give you a perfect experience.





 

Do
you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Kristof Wagemans
Sent: Thursday, August 10, 2006 2:10 PM
To: Discussion of IronPython
Subject: [IronPython] Debugging support PythonEngine







I
have been experimenting with the debugging support for the PythonEngine. When I
use the following code I have several problems.



PythonEngine
_pe;

EngineOptions
options = new EngineOptions();

options.ClrDebuggingEnabled
= true;

_pe
= new PythonEngine(options);

_pe.ExecuteFile(@
script );



Test
script:



x
= 1

y
= 2



def
Add(a, b):


return a + b



z
= Add(x, y)

print
z





I
opened the script file in Visual Studio and placed a breakpoint at the
beginning of the file. The application runs and breaks at the correct location.
Stepping through the lines works, but I cannot see any values of the global
variables.

When
I try to step into the function I get a notification that there is no source
code available and I must show the disassembly. After I step several times
through the assembly instructions I can return to the original source code.
Inside the function I can see the values of the function variables.

I
have tried debugging ipy.exe with the script and there I can see the global
variables, but I still have the problem with stepping into a function. In
ipy.exe the script file is executed in a different way. Using the same method I
can also see the global variables with my PythonEngine instance. I apparently
dont need to set ClrDebuggingEnabled in this case.



PythonEngine
_pe;

_pe
= new PythonEngine();

OptimizedEngineModule
engineModule = _pe.CreateOptimizedModule(@ script
, __main__, true);

engineModule.Execute();



Are
you required to use an OptimizedEngineModule to be able to debug completely? Am
I forgetting some settings for debugging? Can I step directly into a function
without getting into the assembly instructions?









[IronPython] Need help using IronPython from C#

2006-08-11 Thread Jason Ferrara
I'd like to do the equivalent of something like...

import RemoteAdmin

ls = RemoteAdmin.ConnectToService(localhost,LogViewer)
numEntries = ls.GetNumberOfEntries()
e = ls.GetEntry(numEntries - 1)
entryString = str(e)


in C#.

So I get as far as

PythonEngine e = new PythonEngine();
# The RemoteAdmin module is in an assembly built using  
IronPython.Hosting.Compiler and then referenced by the C# project
ClrModule clr = (ClrModule) e.Import(clr);
clr.AddReference(typeof(RemoteAdmin).Assembly)
e.Import(RemoteAdmin);

and then I'm lost.

Is there a way to make a delegate from a method that exists in the  
PythonEngine environment and then call the delegate from C#?

I'm aware of the Evaluate and Execute methods of PythonEngine, but  
I'm looking for a more direct way to call the python methods and  
access python object attributes, rather than building up strings to  
pass to Evaluate.

Thanks

- Jason


___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Embedded IP eating memory

2006-08-11 Thread Dino Viehland








How are you executing the script file? If youre creating a new
optimized module each time we wont be able to collection the optimized module
code. If on the other hand youre just compiling it as a helper method then when
its done running we can collect the code.



In pre-RC1 we had a leak where creating a new PythonEngine would
result in a leak of a SystemState and ClrModule which were being hung onto by
an event rooted in the app domain. So if youre re-creating the engine each
time you might be seeing that. Also, now that Ive mentioned events, you might
want to check your own C# code if youre using events: Its easy to forget to
unhook one and leak memory because the event handler stays alive forever.



If none of those turn out to be the problem an option here would
be to download the free CLR Profiler and look at the object type that is
consuming the increased memory. Itll give you a nice graphical display w/ a
block view of whats referencing what. 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Rodolfo Conde
Sent: Friday, August 11, 2006 12:58 PM
To: Discussion of IronPython
Subject: [IronPython] Embedded IP eating memory






















Hi












I have an IP-Embedded C#application (IP version IronPython 1.0.60523
(Beta) on .NET 2.0.50727.42, Yeah i know, im out of date, but i havent make the
change to latest version because i saw there weresome API changes :) ), i
create one PyEngine, set some global variablesand inside a while block
iexecute this little script every time:











import
sys











try:
i = sys.path.index(scripts)
except:
sys.path.append(scripts)












import CMOpFuncionalidad












try:
pyop = CMOpFuncionalidad.PyOperador(cmop, dba, connID)
pyop.atiendeCM()
pyop.liberaRecursosBD()
pyop = None
except:
pyop.liberaRecursosBD()
pyop = None
raise











The
module CMOpFuncionaliad is an IPython script i wrote, it contains a class
definition. Inside the scripts i use components defined in some assemblies i
made (these are already loaded into the CLR). The problem is,after the
Engine takes the usual 12M+- of memory it needs, every time the script executes
it consumes 2M more, i dont have a clue why is this...Does this version of IP
have memory problems ? Or what else could be ?? If you need to see
CMOpFuncionalidad.py let me know and ill send it



















Thanks for your help












Greetings...














___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Need help using IronPython from C#

2006-08-11 Thread Jason Ferrara

On Aug 11, 2006, at 3:53 PM, Dino Viehland wrote:


 If you really do want to get a delegate to a Python function that  
 came from a module you might want to look at Ops.GetDelegate.  If  
 you were to create a module, execute its contents, and then get the  
 method back out by name as an object you could pass the method to  
 Ops.GetDelegate w/ a delegate type and create a delegate to the raw  
 Python method that you could call from C#.

I think this is closer to what I want. I'm looking for clean way to  
expose an API written in Python to a C# program.

So I can do

MyDelegate ConnectToService = (MyDelegate)  
IronPython.Runtime.Operations.Ops.GetDelegate(e.Evaluate 
(RemoteAdmin.ConnectToService), typeof(MyDelegate));

and then...

object ls = ConnectToService(localhost,LogViewer);

but now how do I get to the methods and attributes of ls?



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:users- 
 [EMAIL PROTECTED] On Behalf Of Jason Ferrara
 Sent: Friday, August 11, 2006 12:08 PM
 To: Discussion of IronPython
 Subject: [IronPython] Need help using IronPython from C#

 I'd like to do the equivalent of something like...

 import RemoteAdmin

 ls = RemoteAdmin.ConnectToService(localhost,LogViewer)
 numEntries = ls.GetNumberOfEntries()
 e = ls.GetEntry(numEntries - 1)
 entryString = str(e)


 in C#.

 So I get as far as

 PythonEngine e = new PythonEngine();
 # The RemoteAdmin module is in an assembly built using  
 IronPython.Hosting.Compiler and then referenced by the C# project  
 ClrModule clr = (ClrModule) e.Import(clr);
 clr.AddReference(typeof(RemoteAdmin).Assembly)
 e.Import(RemoteAdmin);

 and then I'm lost.

 Is there a way to make a delegate from a method that exists in the  
 PythonEngine environment and then call the delegate from C#?

 I'm aware of the Evaluate and Execute methods of PythonEngine, but  
 I'm looking for a more direct way to call the python methods and  
 access python object attributes, rather than building up strings to  
 pass to Evaluate.

 Thanks

 - Jason


 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Need help using IronPython from C#

2006-08-11 Thread Dino Viehland
You're quickly getting into the guts of the runtime, so you'll find most of 
what you want over in Ops.

To get an attribute off of an object you can do TryGetAttr(object o, SymbolId 
name, out object ret).  o would be your ls, SymbolId's our what we use 
internally to represent attributes - you can get one by doing 
SymbolTable.SymbolToId(foo), and then we'll pass you out the value.

As you get the values back you'd need to re-create delegates to them.  Note if 
you're re-creating delegates of the same type we won't need to do any 
additional code gen work - we'll just bind the new object back to the existing 
method we created, so this shouldn't be too nasty to do.  If you're getting a 
property we'll return the property value from Ops.GetAttr (basically if you hit 
a descriptor we will run the descriptor code for you).  And if you're getting 
some plain old attribute back out then you can do whatever you want w/ the 
value from there.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Ferrara
Sent: Friday, August 11, 2006 1:29 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Need help using IronPython from C#


On Aug 11, 2006, at 3:53 PM, Dino Viehland wrote:


 If you really do want to get a delegate to a Python function that came
 from a module you might want to look at Ops.GetDelegate.  If you were
 to create a module, execute its contents, and then get the method back
 out by name as an object you could pass the method to Ops.GetDelegate
 w/ a delegate type and create a delegate to the raw Python method that
 you could call from C#.

I think this is closer to what I want. I'm looking for clean way to expose an 
API written in Python to a C# program.

So I can do

MyDelegate ConnectToService = (MyDelegate) 
IronPython.Runtime.Operations.Ops.GetDelegate(e.Evaluate
(RemoteAdmin.ConnectToService), typeof(MyDelegate));

and then...

object ls = ConnectToService(localhost,LogViewer);

but now how do I get to the methods and attributes of ls?



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:users-
 [EMAIL PROTECTED] On Behalf Of Jason Ferrara
 Sent: Friday, August 11, 2006 12:08 PM
 To: Discussion of IronPython
 Subject: [IronPython] Need help using IronPython from C#

 I'd like to do the equivalent of something like...

 import RemoteAdmin

 ls = RemoteAdmin.ConnectToService(localhost,LogViewer)
 numEntries = ls.GetNumberOfEntries()
 e = ls.GetEntry(numEntries - 1)
 entryString = str(e)


 in C#.

 So I get as far as

 PythonEngine e = new PythonEngine();
 # The RemoteAdmin module is in an assembly built using
 IronPython.Hosting.Compiler and then referenced by the C# project
 ClrModule clr = (ClrModule) e.Import(clr);
 clr.AddReference(typeof(RemoteAdmin).Assembly)
 e.Import(RemoteAdmin);

 and then I'm lost.

 Is there a way to make a delegate from a method that exists in the
 PythonEngine environment and then call the delegate from C#?

 I'm aware of the Evaluate and Execute methods of PythonEngine, but I'm
 looking for a more direct way to call the python methods and access
 python object attributes, rather than building up strings to pass to
 Evaluate.

 Thanks

 - Jason


 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Embedded IP eating memory

2006-08-11 Thread Rodolfo Conde




 Inside the while cycle, i just 
do this:

 pyEngine.RunFile("scripts/CMOpAtiendeCM.py");
 thats the little script file. 
The engine is created only once.

 However, i did inside the 
cyclea Console.WriteLine("{0} bytes", System.GC.GetTotalMemory(true)) and 
it gives lower memory usage, there i see that IP seems to be consuming each time 
the file is run only 2k, no 2m, as the windowstaskmanager 
says

 I do use events, but i do remove 
the handlers when no longer in use...

 Where can i get a free CLR 
profiler ?? :)...

 thanks for the 
help...

 Greetings



  - Original Message - 
  From: 
  Dino Viehland 
  To: Discussion of IronPython 
  Sent: Friday, August 11, 2006 1:48 
  PM
  Subject: Re: [IronPython] Embedded IP 
  eating memory
  
  
  How 
  are you executing the script file? If you’re creating a new optimized 
  module each time we won’t be able to collection the optimized module 
  code. If on the other hand you’re just compiling it as a helper method 
  then when it’s done running we can collect the code.
  
  In 
  pre-RC1 we had a leak where creating a new PythonEngine would result in a leak 
  of a SystemState and ClrModule which were being hung onto by an event rooted 
  in the app domain. So if you’re re-creating the engine each time you 
  might be seeing that. Also, now that I’ve mentioned events, you might 
  want to check your own C# code if you’re using events: It’s easy to 
  forget to unhook one and leak memory because the event handler stays alive 
  forever.
  
  If 
  none of those turn out to be the problem an option here would be to download 
  the free CLR Profiler and look at the object type that is consuming the 
  increased memory. It’ll give you a nice graphical display w/ a block 
  view of what’s referencing what. 
  
  
  
  
  From: 
  [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
  On Behalf Of Rodolfo CondeSent: Friday, August 11, 2006 
  12:58 PMTo: Discussion of IronPythonSubject: 
  [IronPython] Embedded IP eating memory
  
  
  
  
  
  
   
  Hi
  
  
  
   
  I have an IP-Embedded C#application (IP version IronPython 1.0.60523 
  (Beta) on .NET 2.0.50727.42, Yeah i know, im out of date, but i havent make 
  the change to latest version because i saw there weresome API changes :) 
  ), i create one PyEngine, set some global variablesand inside a while 
  block iexecute this little script every 
time:
  
  
  
  import 
  sys
  
  
  
  try:i = 
  sys.path.index("scripts")except:sys.path.append("scripts")
  
  
  
  import 
  CMOpFuncionalidad
  
  
  
  try:pyop 
  = CMOpFuncionalidad.PyOperador(cmop, dba, 
  connID)pyop.atiendeCM()pyop.liberaRecursosBD()pyop 
  = Noneexcept:pyop.liberaRecursosBD()pyop = 
  Noneraise
  
  
  
  The module 
  CMOpFuncionaliad is an IPython script i wrote, it contains a class definition. 
  Inside the scripts i use components defined in some assemblies i made (these 
  are already loaded into the CLR). The problem is,after the Engine takes 
  the usual 12M+- of memory it needs, every time the script executes it consumes 
  2M more, i dont have a clue why is this...Does this version of IP have memory 
  problems ? Or what else could be ?? If you need to see CMOpFuncionalidad.py 
  let me know and ill send it
  
  
  
   
  
  
   
  Thanks for your help
  
  
  
   
  Greetings...
  
  __ 
  Información de NOD32, revisión 1.1703 (20060811) __Este 
  mensaje ha sido analizado con NOD32 antivirus systemhttp://www.nod32.com
  
  

  ___users mailing 
  listusers@lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com__ 
  Información de NOD32, revisión 1.1703 (20060811) __Este 
  mensaje ha sido analizado con NOD32 antivirus 
  systemhttp://www.nod32.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Embedded IP eating memory

2006-08-11 Thread Rodolfo Conde




 PS. The module the script loads 
with import (CMOpFuncionalidad.py) has 15 global-module variables, but with 
import the module loads only once...doesnt it ??

 Cheers...



  - Original Message - 
  From: 
  Dino Viehland 
  To: Discussion of IronPython 
  Sent: Friday, August 11, 2006 1:48 
  PM
  Subject: Re: [IronPython] Embedded IP 
  eating memory
  
  
  How 
  are you executing the script file? If you’re creating a new optimized 
  module each time we won’t be able to collection the optimized module 
  code. If on the other hand you’re just compiling it as a helper method 
  then when it’s done running we can collect the code.
  
  In 
  pre-RC1 we had a leak where creating a new PythonEngine would result in a leak 
  of a SystemState and ClrModule which were being hung onto by an event rooted 
  in the app domain. So if you’re re-creating the engine each time you 
  might be seeing that. Also, now that I’ve mentioned events, you might 
  want to check your own C# code if you’re using events: It’s easy to 
  forget to unhook one and leak memory because the event handler stays alive 
  forever.
  
  If 
  none of those turn out to be the problem an option here would be to download 
  the free CLR Profiler and look at the object type that is consuming the 
  increased memory. It’ll give you a nice graphical display w/ a block 
  view of what’s referencing what. 
  
  
  
  
  From: 
  [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
  On Behalf Of Rodolfo CondeSent: Friday, August 11, 2006 
  12:58 PMTo: Discussion of IronPythonSubject: 
  [IronPython] Embedded IP eating memory
  
  
  
  
  
  
   
  Hi
  
  
  
   
  I have an IP-Embedded C#application (IP version IronPython 1.0.60523 
  (Beta) on .NET 2.0.50727.42, Yeah i know, im out of date, but i havent make 
  the change to latest version because i saw there weresome API changes :) 
  ), i create one PyEngine, set some global variablesand inside a while 
  block iexecute this little script every 
time:
  
  
  
  import 
  sys
  
  
  
  try:i = 
  sys.path.index("scripts")except:sys.path.append("scripts")
  
  
  
  import 
  CMOpFuncionalidad
  
  
  
  try:pyop 
  = CMOpFuncionalidad.PyOperador(cmop, dba, 
  connID)pyop.atiendeCM()pyop.liberaRecursosBD()pyop 
  = Noneexcept:pyop.liberaRecursosBD()pyop = 
  Noneraise
  
  
  
  The module 
  CMOpFuncionaliad is an IPython script i wrote, it contains a class definition. 
  Inside the scripts i use components defined in some assemblies i made (these 
  are already loaded into the CLR). The problem is,after the Engine takes 
  the usual 12M+- of memory it needs, every time the script executes it consumes 
  2M more, i dont have a clue why is this...Does this version of IP have memory 
  problems ? Or what else could be ?? If you need to see CMOpFuncionalidad.py 
  let me know and ill send it
  
  
  
   
  
  
   
  Thanks for your help
  
  
  
   
  Greetings...
  
  __ 
  Información de NOD32, revisión 1.1703 (20060811) __Este 
  mensaje ha sido analizado con NOD32 antivirus systemhttp://www.nod32.com
  
  

  ___users mailing 
  listusers@lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com__ 
  Información de NOD32, revisión 1.1703 (20060811) __Este 
  mensaje ha sido analizado con NOD32 antivirus 
  systemhttp://www.nod32.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] pdb files

2006-08-11 Thread jeff sacksteder
I have compiled my application to an exe.Must I distribute the .pdb files along with my app or can I just delete them?
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com