Leg and muscle cramps are not a natural part of aging. For most people, they are due to the calcification of the body and/or an electrolyte imbalance (caused by poor diet, illness or medication use).
Cause 1: Calcification. Excess calcium accumulation (calcification) makes muscles hard and tight -- causing cramps. A cramp is just a tight muscle that won't relax. The solution to calcification is two-fold: decrease your intake of calcium until the cramps go away (and also decrease your intake of Vitamin D, which greatly accelerates the absorption of calcium). This does not mean to cut them out 100% -- but simply to take less. At the same time, you need to increase your intake of magnesium, which counteracts calcium in your body. Calcium and magnesium are "antagonists", meaning they exert opposite effects: Calcium makes things tight, magnesium makes things loose.
Cause 2: Electrolyte imbalance. In order for your muscles to function properly, there has to be a balance of 4 electrolytes -- sodium, potassium, calcium and magnesium. Many medications, especially blood pressure medications, interfere with this balance -- causing cramps. You need to ask your doctor if your medications might be causing cramps. But how can you restore your electrolyte balance? By what you ingest. Although most people get enough sodium, potassium and calcium from food (unless they follow a very limited or restricted diet), it is difficult to get enough magnesium, unless you eat large amounts of nuts, seeds, and green leafy vegetables like spinach and kale. For most people, the solution is the exact same as for calcification: take a magnesium supplement.
What type of magnesium supplement do you need? It needs to be high absorbing, and not cause stomach upset or diarrhea. You need to take it every day to keep your levels high, because you are constantly losing it through urine and sweat. It is better to take capsules than tablets, because tablets are hard and difficult to digest. Organic forms of magnesium, such as those found in fruits and vegetables, are better than inorganic forms, like those found in rocks.
By fighting calcification and electrolyte imbalance with diet and magnesium supplementation, most people see their cramps disappear permanently.