How to relieve sudden cramps in swimming?

If the water level is shallow, you can stand up and push down; if you are in deep water, bend the leg on the side of the cramp, then pull the toes apart and break them straight, and repeat the above action until the symptoms are mild.