I have not fasted before, but I started getting leg and foot cramping routinely about 6 monhs ago, the same thing - very bad, I would have to get out of bed and walk around, sometimes it took awhile. I think that's a mineral deficiency - possibly magnesium deficiency, in particular, because mine virtually disappeared once I started taking a magnesium supplement. I bought "Natural Calm," the kind that fizzes and dissolves in hot water. Since then, no more cramping, though I do feel it's a compromise to be getting it from a bottle instead of food. I don't know what you could take in the way of food or herbs that would contain natural magnesium, and if you are fasting, I guess maybe in that fasting process you lose minerals, perhaps that is why you are getting the cramping. Maybe you could take a magnesium supplement like that while you are fasting?