Your memory foam mattress needs to rest on a flat, even surface. That surface can be a piece of moisture-resistant plywood, a mattress foundation, or even your floor. Solid and slatted surfaces can support a memory foam mattress, but if there are slats you’ll want to check their spacing. The slats should be no more than 3 inches apart.