The various causes of knee locking are torn medial meniscus, mis-aligned knee cap, osteoarthritis, knee arthritis, torn lateral meniscus, osteochondritis dissecans, recurrent patella dislocation, chondromalacia patella, knee alignment problem, knee fragment or knee cartilage disorder. True knee locking is caused by either a torn piece of cartilage, or a loose bone fragment due to a bone disorder called osteochondritis dissecans. Sometimes misalignment of the bones and muscles around the knee cause this obstruction. Please discuss with your doctor. You may need MRI of the joint. Take care!
The medical advice given should not be considered a substitute for medical care provided by a doctor who can examine you. The advice may not be completely correct for you as the doctor cannot examine you and does not know your complete medical history. Hence this reply to your post should only be considered as a guiding line and you must consult your doctor at the earliest for your medical problem.