-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-System.Dynamic.Runtimebughelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors
Milestone
Description
The application included below will rapidly consume available memory and if allowed to run long enough it will eventually crash with OutOfMemoryException ('Array dimensions exceeded supported range') while trying to resize the backing array of the dictionary used by Microsoft.CSharp.RuntimeBinder.Semantics.SYMTBL.InsertChildNoGrow.
In the example below the issue can be avoided by either removing the cast to 'dynamic' or by removing at least 9 of the items in the 'entities' array.
namespace DynamicTest
{
public static class Program
{
public static void Main()
{
var entities = new object[]
{
new T01(),
new T02(),
new T03(),
new T04(),
new T05(),
new T06(),
new T07(),
new T08(),
new T09(),
new T10(),
new T11(),
new T12(),
new T13(),
new T14(),
new T15(),
new T16(),
new T17(),
new T18(),
new T19(),
new T20()
};
var len = entities.Length;
while (true)
{
for (var i = 0; i < len; i++)
for (var j = 0; j < len; j++)
entities[i].Equals((dynamic)entities[j]);
}
}
}
public class T01 : object { }
public class T02 : object { }
public class T03 : object { }
public class T04 : object { }
public class T05 : object { }
public class T06 : object { }
public class T07 : object { }
public class T08 : object { }
public class T09 : object { }
public class T10 : object { }
public class T11 : object { }
public class T12 : object { }
public class T13 : object { }
public class T14 : object { }
public class T15 : object { }
public class T16 : object { }
public class T17 : object { }
public class T18 : object { }
public class T19 : object { }
public class T20 : object { }
}
Metadata
Metadata
Assignees
Labels
area-System.Dynamic.Runtimebughelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors