Random-access memory (RAM) is a fast electronic device used in computers to temporarily store data. Traditional RAM is based on the flow of electrical current for data processing. To make RAM faster, more energy efficient and capable of storing more information in a smaller volume, hardware developers are investigating RAM based on magnetic fields. Miniaturization of these devices, however, is hampered by thermal instabilities.