I get cramps most nights, much worse if I've done any exercise that day. Walking and stretching before bed helps. I drink electrolyte replacement after any exercise, and I take Cal-Mag supplements, three in the morning and one at night. I started on a lower dose, but have upped it, and it's much mroe effective.
Soaking your feet in Lectric Soda is also good.