That is a great question. Swimming is a very intensive sport, and it quickly can diminish the bodies reserve in terms of the nutrients that the muscles need to continue to work aggressively for a long period of time. Of course, as you mentioned, stretching, eating a healthy diet, working on improving your muscle strength and mass with weight training exercises (both fast and slow muscle related exercises) are all important ways to help diminish the leg cramping symptoms you are feeling. There are also vitamins and minerals that can play a role in your bodies ability to go for long periods of time without developing cramps, calcium, magnesium and potassium being just a few. The other major cause of leg cramping during vigorous exercise is dehydration. If your body is not hydrated, it is very common to experience leg cramping that can be extremely painful and may require you to stop and stretch. Of course, your primary care doctor
will be best able to assess your medical history and presenting complaints and decide upon the proper workup for your complaints, and treatment options if they are available. Consider starting off by taking a multivitamin and increasing your pre-workout hydration.