Compensating for the two-fold variation in X-chromosome:autosome ratios between sexes by a global inactivation of all, or most of, the genes on one of the X-chromosomes in the XX sex by the mechanism of heterochromatin formation.