A memory system includes physical memory devices or ranks of memory devices that
can be set to reduced power modes. In one embodiment, a hardware memory controller
receives memory instructions in terms of a logical address space. In response to
the relative usages of different addresses within the logical address space, the
memory controller maps the logical address space to physical memory in a way that
reduces the number of memory devices that are being used. Other memory devices
are then set to reduced power modes. In another embodiment, an operating system
maintains a free page list indicating portions of physical memory that are not
currently allocated. The operating system periodically sorts this list by group,
where each group corresponds to a set or rank of memory devices. The groups are
sorted in order from those receiving the heaviest usage to those receiving the
lightest usage. When allocating memory, the memory is allocated from the sorted
page list so that memory is preferentially allocated from those memory devices
that are already receiving the highest usage.