Hi ironpython,
Here's your Daily Digest of new issues for project "IronPython".
In today's digest:ISSUES
1. [New comment] Memory Leak
----------------------------------------------
ISSUES
1. [New comment] Memory Leak
http://ironpython.codeplex.com/workitem/31764
User koreney has commented on the issue:
"<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>"
----------------------------------------------
----------------------------------------------
You are receiving this email because you subscribed to notifications on
CodePlex.
To report a bug, request a feature, or add a comment, visit IronPython Issue
Tracker. You can unsubscribe or change your issue notification settings on
CodePlex.com.
_______________________________________________
Ironpython-users mailing list
Ironpython-users@python.org
https://mail.python.org/mailman/listinfo/ironpython-users