3

I've got this the simplest query ever in my LINQPad:

var xml = XElement.Load(@"C:\\Users\\myth\sample.xml");
var query =
    from e in xml.Elements()
    select e;
query.Dump();

The problem is that it gives me back System.OutOfMemoryException. XML file is around 120MB.
I've read it here that LINQPad has a limitation of returning only 10000 rows.

So, then I've tried putting it like this

var query =
    (from e in xml.Elements()
    select e).Take(100);
query.Dump();

yet it gave me back the same error.

LINQPad version: v4.45.05

1
  • I put your code in against an XML file I created that is 168MB. It returns the first 1000 items without a problem. Are you outputting to grid or rich text? When I changed to grid I also got an out of memory exception. Perhaps this stackoverflow.com/questions/5838657/… will give you a different way that may work you? Aug 28, 2013 at 11:01

1 Answer 1

6

Figured it out by myself.

When you are dealing with huge XML files (>100MB) or any other massive queries whatsoever, you need to have X64 Build installed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.