Why do your joints crack?

Two reasons, too much phosphorous in the weed or im not sure

This happens to me and my doctor says there are airbubbles in between the joints. The cracking is you're bones moving (popping the bubble).