Hi ironpython,
Here's your Daily Digest of new issues for project "IronPython".
In today's digest:ISSUES
1. [New comment] Memory Leak when using AppDomains
----------------------------------------------
ISSUES
1. [New comment] Memory Leak when using AppDomains
http://ironpython.codeplex.com/workitem/33242
User Loupi has commented on the issue:
"<p>Hello,</p><p>I'd like to add my two cents on that. After raising that bug
almost 2 years ago,<br>I've used a workaround solution with Code Access
Security. First, I created a PermissionSet like
this:</p><p>```<br>PermissionSet CreatePermissions()<br> {<br>
PermissionSet permissions = new PermissionSet(null);<br>
permissions.AddPermission(new
SecurityPermission(SecurityPermissionFlag.Execution));<br>
permissions.AddPermission(new
ReflectionPermission(ReflectionPermissionFlag.MemberAccess));<br>
permissions.AddPermission(new FileIOPermission(FileIOPermissionAccess.Read |
FileIOPermissionAccess.PathDiscovery,<br>
AccessControlActions.View,
AppDomain.CurrentDomain.BaseDirectory));</p><p> new Type[] <br>
{<br> typeof(DateTime),<br>
typeof(Uri),<br>
typeof(IronPython.BytesConversionAttribute),<br>
typeof(IronPython.Modules.ArrayModule),<br>
typeof(Enumerable),<br> typeof(SandBox)<br> }<br>
.Select(t =>
t.Assembly.Evidence.GetHostEvidence<StrongName>())<br>
.Select(t => permissions.AddPermission(new
StrongNameIdentityPermission(t.PublicKey, t.Name, t.Version)));</p><p>
return permissions;<br> }<br>```</p><p>Then I executed Python scripts
like that:</p><p>```<br>private void RunWorkflowInternal(CompiledCode
compiledCode, ScriptScope scriptScope)<br> { <br>
myPermissionSet.PermitOnly();<br>
compiledCode.Execute(scriptScope);<br> }<br>```</p><p>No app domain
involved. This solution worked with millions of script executions, on a single
ScriptEngine, on the same windows service process, for months (no reboot, no
recycle, no process kill).</p><p>Then came KB2835393, which contains a new
memory leak with Code Access Security. So after applying KB2835393 OR
installing .NET 4.5 (which affects 4.0 too), myPermissionSet.PermitOnly()
leaks.</p><p>I opened a case with my MSDN account, it is currently in the
escalation state.</p><p>Just wanted to let you know in case it could be
usefull/related.</p><p>Regards<br>Loupi<br></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