A method and apparatus for stray magnetic field compensation in a
non-volatile memory cell, such as a spin-torque transfer random access
memory (STRAM). In some embodiments, a first tunneling barrier is coupled
to a reference structure that has a perpendicular anisotropy and a first
magnetization direction. A recording structure that has a perpendicular
anisotropy is coupled to the first tunneling barrier and a nonmagnetic
spacer layer. A compensation layer that has a perpendicular anisotropy
and a second magnetization direction in substantial opposition to the
first magnetization direction is coupled to the nonmagnetic spacer layer.
Further, the memory cell is programmable to a selected resistance state
with application of a current to the recording structure.