there are numerous causes to leg-cramps: the causes of which are very difficult to pin-point; dehydration for example is a known cause, so make sure you are drinking enough fluids and water; magnesium, potassium, and calcium deficiencies are also known causes.
Many people find leg cramps cause particular trouble at night, where the pain disturbs sleep or even wakes them up: night-cramps are rarely serious, but can cause a lot of discomfort as you probably know already!!
However, if your leg cramps occur during or immediately after exercise, this may be a sign your muscles aren't getting an adequate supply of oxygen, or that toxic chemicals produced by the activity of busy muscles aren't being cleared fast enough from the area. For most people, this is a common problem while the muscles get used to an increased amount of exercise, and it should settle as the body adapts to it
However,(without wanting to be alarmist) leg cramps may be a sign of arteriosclerosis (or 'hardening of the arteries'), where the arteries are clogged by fatty deposits, limiting the supply of blood to the muscles.
When you exercise, your leg muscles need more oxygen, and this is supplied by the blood flowing to the muscles. But in atherosclerosis the arteries are narrowed, so the blood supply to the muscles is limited, meaning the muscles can't get enough oxygen. The muscles then switch to anaerobic metabolism, which doesn’t need oxygen, but results in the build-up of chemicals that can trigger pain and spasm, usually in the calves. When you rest, the pain lessens. This is called intermittent claudication.
In mild cases, you may notice your legs are cold, with dry skin and few hairs. As it gets worse, the limbs may become blue, ulcerated and even gangrenous. Smokers, people with high cholesterol levels or diabetes and those with a family history of heart disease are all at particular risk. Intermittent claudication needs thorough investigation, so I would go to your GP for a thorough investigation if this is causing you much concern.
I would personally begin with making sure you are drinking enough fluids, and then secondly I would supplement with a high quality Calcium, Magnesium (2 to 1 ratio), and Potassium, to eliminate these possibilities before contemplating further investigation.