They always say bananas work before you go to bed. Lol. I think it is because of the potassium in the bananas to prevent charlie horses somehow. It also wouldn't hurt to try Restless Legs pills that dissolve under the tongue. My mom uses them and says that they work for pain in the legs. The legs need to have good circulation, and it isn't wise to not stretch them. Make it a habit to change positions if you sit for long periods of time or stand for a long time as well. Massaging them helps, and drinking lots of water because that is the joints lubrication. When you hear peoples bones crack, that's because they don't drink enough water.