I have a piece of code that makes the Visual Studio 2008 IDE run very slow, consume vast amounts of memory and then eventually causes it to crash. I suspect VS is hitting an OS memory limit.
The following code is not my real application code, but it simulates the problem. Essentially I am trying to find the minimum value within a tree using LINQ.
class LinqTest
{
public class test
{
public int val;
public List<test> Tests;
}
private void CrashMe()
{
test t = new test();
//Uncomment this to cause the problem
//var x = t.Tests.Min(c => c.Tests.Min(d => d.Tests.Min(e => e.Tests.Min(f=>f.Tests.Min(g=>g.Tests.Min(h => h.val))))));
}
}
Has anyone else seen something similar?