fix oom error dues to bad estimation

This fix imposes a maximum on the number of records to wait for before checking that we have reached the block size.
based on the first 100 records it can sometimes grossly underestimate the size used and wait too long before checking again.
With this change we will check a minimum of once every 10,000 records