I'm sorry to hear about your elbow pain and I recommend you consult your physician. Assuming that you didn't injure your elbow previously, your symptoms sound consistent with either a loose body or elbow arthritis
. We'll start with the former, but honestly loose bodies often occur in the setting of arthritis, so the two really aren't mutually exclusive. A loose body is essentially a loose piece of bone or cartilage that gets dislodged and stuck in the joint. The loose body can get stuck in the joint like a pebble in a shoe, and depending on its location, this entrapment and impingement can cause pain and mechanical symptoms like popping, clicking, or locking. Alternatively, arthritis can have very similar symptoms because of the bone spurs and loss of joint space. In fact, night time stiffness and pain can be characteristic of arthritis. The elbow joint becomes mechanically stiff due to bone spurs and the fact that you don't move your elbow much while sleeping, but grinding of bone against bone when you move it inadvertently can awaken you due to pain. The fact that you have somewhat similar symptoms in your knee makes it more likely that your elbow pain is from arthritis, since arthritis seldom only affects one joint. Again, it is important to keep in mind loose bodies often occur in the setting of arthritis so your symptoms may represent both of these things. As always, you should always consult your physician regarding your symptoms to undergo the appropriate evaluation and treatment.