clean up chunk memory calculation