Freed the file buffer right after tokenizing it. Forgot to do this earlier, should make a huge difference for large files.