<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word" xmlns:m = 
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<STYLE>@font-face {
        font-family: Cambria Math;
}
@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Segoe UI;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"; mso-style-builtin: yes
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"; mso-style-builtin: yes
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"; mso-style-builtin: yes
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-builtin: yes; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-builtin: yes; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-builtin: yes; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-builtin: yes; mso-style-priority: 99
}
SPAN.EmailStyle17 {
        COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-reply
}
.MsoChpDefault {
        FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue bgColor=white>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 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 ??</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; Cheers...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=dinov@exchange.microsoft.com 
  href="mailto:dinov@exchange.microsoft.com">Dino Viehland</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=users@lists.ironpython.com 
  href="mailto:users@lists.ironpython.com">Discussion of IronPython</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, August 11, 2006 1:48 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [IronPython] Embedded IP 
  eating memory</DIV>
  <DIV><BR></DIV>
  <DIV class=Section1>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">How 
  are you executing the script file?&nbsp; If you’re creating a new optimized 
  module each time we won’t be able to collection the optimized module 
  code.&nbsp; 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.<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">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.&nbsp; So if you’re re-creating the engine each time you 
  might be seeing that.&nbsp; Also, now that I’ve mentioned events, you might 
  want to check your own C# code if you’re using events:&nbsp; It’s easy to 
  forget to unhook one and leak memory because the event handler stays alive 
  forever.<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">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.&nbsp; It’ll give you a nice graphical display w/ a block 
  view of what’s referencing what.&nbsp; <o:p></o:p></SPAN></P>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
  <DIV>
  <DIV 
  style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
  <P class=MsoNormal><B><SPAN 
  style="FONT-SIZE: 9pt; FONT-FAMILY: 'Segoe UI','sans-serif'">From:</SPAN></B><SPAN 
  style="FONT-SIZE: 9pt; FONT-FAMILY: 'Segoe UI','sans-serif'"> 
  users-bounces@lists.ironpython.com [mailto:users-bounces@lists.ironpython.com] 
  <B>On Behalf Of </B>Rodolfo Conde<BR><B>Sent:</B> Friday, August 11, 2006 
  12:58 PM<BR><B>To:</B> Discussion of IronPython<BR><B>Subject:</B> 
  [IronPython] Embedded IP eating memory<o:p></o:p></SPAN></P></DIV></DIV>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp;&nbsp;&nbsp; 
  Hi....</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp;&nbsp;&nbsp; 
  I have an IP-Embedded C#&nbsp;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 were&nbsp;some API changes :) 
  ), i create one PyEngine, set some global variables&nbsp;and inside a while 
  block i&nbsp;execute this little script every 
time:</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">import 
  sys</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">try:<BR>&nbsp;i = 
  sys.path.index("scripts")<BR>except:<BR>&nbsp;sys.path.append("scripts")</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"><BR>import 
  CMOpFuncionalidad<o:p></o:p></SPAN></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp;<o:p></o:p></SPAN></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"><BR>try:<BR>&nbsp;pyop 
  = CMOpFuncionalidad.PyOperador(cmop, dba, 
  connID)<BR>&nbsp;pyop.atiendeCM()<BR>&nbsp;pyop.liberaRecursosBD()<BR>&nbsp;pyop 
  = None<BR>except:<BR>&nbsp;pyop.liberaRecursosBD()<BR>&nbsp;pyop = 
  None<BR>&nbsp;raise<o:p></o:p></SPAN></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp;<o:p></o:p></SPAN></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">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,&nbsp;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....<o:p></o:p></SPAN></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp;<o:p></o:p></SPAN></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp;&nbsp;&nbsp; 
  <o:p></o:p></SPAN></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp;&nbsp;&nbsp; 
  Thanks for your help....<o:p></o:p></SPAN></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp;<o:p></o:p></SPAN></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp;&nbsp;&nbsp; 
  Greetings...<o:p></o:p></SPAN></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp;<o:p></o:p></SPAN></P></DIV></DIV><BR><BR>__________ 
  Información de NOD32, revisión 1.1703 (20060811) __________<BR><BR>Este 
  mensaje ha sido analizado con NOD32 antivirus system<BR><A 
  href="http://www.nod32.com">http://www.nod32.com</A><BR>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>users mailing 
  list<BR>users@lists.ironpython.com<BR>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com<BR><BR><BR>__________ 
  Información de NOD32, revisión 1.1703 (20060811) __________<BR><BR>Este 
  mensaje ha sido analizado con&nbsp; NOD32 antivirus 
  system<BR>http://www.nod32.com<BR><BR></BLOCKQUOTE></BODY></HTML>