Avoid eating just before exercising. Most likely you will get a cramp (or if you have given too big a gap too, interestingly). This is because the muscles need blood flow to ferry blood glucous. But since you have eaten, the blood flow gets directed to the stomach -- and then a cramp results, when u have eaten too close to exercise time. When u have not eaten for long, again the cramp happens because the blood sugar is dipping.