Although the risk of getting night cramps increases as you get older, there may be many causes including dehydration, prolonged sitting, or not getting enough essential minerals in your diet such as potassium calcium, or magnesium.  These minerals also may be depleted due to certain medication you may be on, such as those that control high blood pressure.  Diabetes, or other conditions such as hyperthyroid or hypothyroidism that affect your metabolism may also have an effect on leg cramps.  There are simple ways to reduce their occurrence, such as staying hydrated, doing light stretching before bed, keeping covers untucked and loose, and even wearing proper support in your shoes.