Cancer and its treatment can cause a variety of issues that can lead to muscle cramps and spasms in the legs, ankles, and feet. These painful contractions can be caused by tumors that press against a muscle, certain types of leukemia that cause the body to produce too many white blood cells, or other conditions and medications not related to cancer. A muscle contraction and a muscle spasm are both involuntary contractions of a muscle, but they are not exactly the same thing. A spasm is an uncontrollable contraction of a muscle group that is served by a single motor nerve fiber.
When it comes to cancer, some types can cause leg cramps, especially if the tumor starts in the muscle or presses on a muscle. To help prevent cramps, it is important to change positions frequently when sitting or lying in bed for long periods of time.