updateBlocksize function

Update blocksize of data to be read depending on available memory.