The heaps process (also known as a Tsetlin library) provides a model for a self-regulating filing system. Items are requested from time to time according to their popularity and returned to the top of the heap after use. The size-biased permutation of a collection of popularities is a particular random permutation of those popularities, which arises naturally in a number of applications and is of independent interest. For a slightly non-standard formulation of the heaps process we prove that it converges to the size-biased permutation of its initial distribution. This leads to a number of new characterizations of the property of invariance under size-biased permutation, notably what might be described as invariance under ‘partial size-biasing' of any order. Finally we consider in detail the heaps process with Poisson–Dirichlet initial distribution, exhibiting the tractable nature of its equilibrium distribution and explicitly calculating a number of quantities of interest.