I have 2GB ram, and I checked that the taskmanager and I have more than enough memory left. I tried to ReadToEnd() a file that has 194 mb. Yet as soon as it passes the code, the returned string is a null. The file exists, and I tried other files(which are smaller) and it works. The code is as follows:

System.IO.StreamReader sr = new System.IO.StreamReader(@"c:\file1.csv");
string str = sr.ReadToEnd();

Why is it giving me out of memory exception?