If you are reading files that big you may wish to consider using some level of buffering instead of reading the whole file to memory at once.