Thanks for posting your query.
which you are suffering ,seems not to be related due to sex or mausterbation. The cause might be arthritic, inflammatory, infective or due to crystal deposition.
I suggest you to consult an orthopaedician/ Rheumatologist
nearby for a detailed clinical examination, some investigations to diagnose the condition and definitive treatment according to that.
Wishing you good health
Dr Saurabh Gupta