When I was a young bloke I used to get these often and on going to the doc was told that there are many causes and named just a few; sitting on cold things, eg; cold concrete, sitting on hot things, again hot concrete for example, prolonged and/or frequent erections, (obviously for blokes), riding horses, (lack of support around the area), constipation, just to name a few.
I never had the need to use any medication, (and yep, I walked and sat funny), and the only worse cases I know of is when they bleed. I learnt that if I applied pressure directly on the problem, and did this as often as I could, they cleared up pretty quick. In effect what I was doing was pushing the blood back into the body, (I can't explain this properly). If I could apply this pressure with a finger, (yeah, I know that sounds off, but compared to the alternative?),and maintain the pressure for a while, the blood buildup eventually dissipated back through the body after several applications.
I can state that these issues are a memory now, as the moment I get ANY sensation that an issue may be forthcoming I get straight 'onto' it so to speak. I also know that there can be no muscle 'tenseness' around that area because any tenseness will possibly bring on another bout. 'Touch wood' these are, as I said, a distant memory. And it is right, once you have had one the weakness at that spot is there forever so all that can be done is...diet and not exposing oneself to situations which may start them up again. People tend to be a little repulsed at my solution but, hey, they still suffer with theirs, I DON'T...I'm happy!