Calculating DIST_INFINITY based on cache sizes.