Memory foam mattresses are typically constructed from dense foam material. Your body temperature softens the foam, which then molds to the shape of your body as you sleep.