Cramps are not well understood or easily treatable. However, one way to get them is to push yourself too hard. This time of year, as it gets warmer, one thing to keep in mind is that heat lowers your muscle's capacity. So some amount of effort that would have been fine when it was colder is now pushing yourself too hard.