These are muscle spasms. I'm working with two athletes that are very prone to them. Both of them tend to get it in there gasrocnemius muscles. Two-joint muscles like the gastroc and the bicep femoris (one of the hamstring muscles) are very prone to cramps / spasms. While the problems seem to reoccur I've found a couple things to be fairly helpful: static stretch the specific muscle intermittently throughout the workout, drink water with small quantities of sodium, stay warm.