in reply to Re: Out of memory problem when copying contents of file into array
in thread Out of memory problem when copying contents of file into array

Unfortunately, for loops build a list out of their contents, which means that the code above will read the entire file into memory. while is the right way to process a line at a time.