C# Entity Framework 6: Out Of Memory when it absolutely should not run out of memory
问题 I've simplified things as much as possible. This is reading from a table that has around 3,000,000 rows. I want to create a Dictionary from some concatenated fields of the data. Here's the code that, in my opinion, should never, ever throw an Out Of Memory Exception: public int StupidFunction() { var context = GetContext(); int skip = 0; int take = 100000; var batch = context.VarsHG19.OrderBy(v => v.Id).Skip(skip).Take(take); while (batch.Any()) { batch.ToList(); skip += take; batch = context