Write all data always by chunks. THis will help to use script with big csv files.