off-by-one errors were shrinking the total available memory