<html><head><style type="text/css" media="screen">Body{font-family: Verdana;font-size:.75em;}h4{font-size:.9em;}a{color: #3a62a6;}.digest .toc {margin-bottom: 15px; padding-bottom:8px; border-bottom: 1px solid #ccc;}.digest .tocItem {margin-bottom: 15px;}.tocItem a{color:#000;text-decoration: none;}.tocItem a:hover{color: #3a62a6;text-decoration: underline;}.topic{padding-bottom: 8px;margin-bottom: 20px; border-bottom: 1px solid #ccc;}.topicHeader{margin-bottom:10px;}.topicTitle{font-weight: bold;}.replies p{margin:0;padding:0;}.replies hr{width: 15%;text-align: left;margin: 0 auto 5px 0;border: none 0;border-top: 1px solid #ccc;height: 1px;}.reply{margin-bottom: 6px;padding-bottom: 4px;}.anchorMarker{color: #3a62a6;}.footer{color: gray;}</style></head><body><div class="digest"><p>Hi ironpython,</p><p>Here's your Daily Digest of new issues for project "<a href="http://ironpython.codeplex.com/">IronPython</a>".</p><p>In today's digest:</p><h4>ISSUES</h4><div class="toc"><div class="tocItem"><a href="#toc_issue_1">1. <span class="tocTitle">[New comment] Memory Leak</span> <span class="anchorMarker">↓</span></a></div></div><h4>ISSUES</h4><div class="topic"><a name="toc_issue_1"></a><div class="topicHeader"><span class="topicTitle">1. [New comment] Memory Leak</span> <a href="http://ironpython.codeplex.com/workitem/31764">view online</a></div><p>User koreney has commented on the issue:</p><p>"<p>I've had a look on that leak and I think I found a workaround for the problem.<br>It is not an actual fix but its what I managed to achieve in the time I had for investigating it.</p><p>It seems that the tree of objects holding all that memory is:</p><p>PythonContext --> Stack<PythonTracebackListener> --> PythonTracebackListener[] --> PythonTracebackListener --> PythonContext --> DebugContext --> Many more objects</p><p>This is the root path and it looks like it is being held because of some static delegates which are not cleared properly.<br>For every script execution done, more objects are added under the DebugContext class. This is valid only if SetTrace have been used.</p><p>What I did as a workaround is the following:</p><p>PythonContext.cs, Ln 4041 - Changed DebugContext property to public to allow access to the debug information saved in each code execution. <br>DebugContext.cs, Ln 88 - Added function ResetAllSourceFiles() which clears the _sourceFiles dictionary that holds the debug information.<br>sys.cs, Ln 830 - Disable the ZipImporter. Didn't have time to get fully into this but it seems it causes a leak as well. Since I don't import from zip files i disabled it completely.</p><p>Now, after every source code execution I call the ResetAllSourceFiles() method from the DebugContext, Like this:</p><p>var pyContext = HostingHelpers.GetLanguageContext(Engine) as PythonContext;<br>pyContext.DebugContext.ResetAllSourceFiles();</p><p><br>The above is based on: IronLanguages-main-568c234</p><p>See the attached source code for changes i've made. <br>The above changes are marked in the files with: "// XXX XXX Koren".</p>"</p></div><div class="footer"><p>You are receiving this email because you subscribed to notifications on CodePlex.</p><p>To report a bug, request a feature, or add a comment, visit <a href="http://ironpython.codeplex.com/workitem/list/basic">IronPython Issue Tracker</a>. You can <a href="http://ironpython.codeplex.com/subscriptions/workitem/project/edit">unsubscribe or change your issue notification settings</a> on CodePlex.com.</p></div></div></body></html>