A question about reading files and memory management