magnesium deficiency can cause cramps. Restore potassium, magnesium and calcium concentration in your blood. For example, eat more bananas, peaches, cheese like cheddar, dried apricots, chocolates, cod liver, sea food, etc. Take 250mg vitamin E a day to prevent nocturnal leg cramps. Studies suggest that taking vitamin E improves blood flow through the arteries. Cramps are often caused by dehydration, so if you get cramp frequently, drink more water. Try drinking less water before and during a workout. In some cases, drinking a lot of water prior to working out may actually cause more cramps. But do drink plenty of water throughout the day, just not right before exercising.