fixed OOM error with f.sync=true