I know one thing that can cause that popping in the knee and makes sense since you also notice swelling is if the tendons in the knee swell.
But then I read this : https://www.webmd.com/pain-management/knee-pain/features/knee-cracks-pops#1. Lots of things can cause it so the big question is if you also have pain? A doctors evaluation is in order if you do or otherwise, if it is appropriate for you and you don't have a reason to NOT take them, then try an NSAID like ibuprofen for selling. Popping happens but this is new so get it checked out!