System.OutOfMemoryException When trying to read 2.09 GB text file
I am trying to read a txt file which consists of millions of lines. I am using this method.
string[] srLines= File.ReadAllLines("my_file.txt");
I have 16 GB DDR3 RAM memory. What is the solution? Thank you.
I am using Microsoft Visual Studio 2010 and Windows 7 64-bit.
Have you set your target to be 64bit as well?
In all cases .NET processes have a limit of memory allocatable per object (see http://blogs.msdn.com/b/joshwil/archive/2005/08/10/450202.aspx), I am not sure if that changed with .NET 4.0