On the management of multilevel memories