Improve memory management in bulk load