guess how much memory will be needed and adjust chunk size