Merge "Avoid redundant getAllocatableBytes() calls." into pi-dev