I had similar problems too!
When I was about 19/20, I fell twisting my knee really bad. It made such a loud cracking noise I thought I broke my leg! But when I got up, I was totally fine and continued doing what I was doing. That night, I went to sleep, woke up, stood up and fell right down! My knee was in so much pain! I went to the doctor and he said I probably bruised the cartilage in my knee and to take it easy which I did and it went away.
About a year later, my knee gave out on me and when it gave out, it sent huge waves of pain! But it only lasted a second.
The next year, the same thing, only it happened maybe 3 or 4 times that year.
Year after that, it happened maybe 4 or 5 times a year but it wasn't just for a second, it would last all day. The pain was so severe that I couldn't bend or straighten out my knee.
This kept getting worse until about 5 years after the 'accident' it was happening like every month and it would last for weeks! I finally went to a knee specialist and he said he couldn't really tell what was wrong unless he did arthoscopic surgury and I agreed.
So, I had the surgury and when it was done, he said to me that there wasn't anything wrong! He did scrape a bit of rough edges but the only thing he noticed was that I had a fully formed "plica" or "plika" in my left knee. Apparantly everyone's born with them but they basically disintegrate as we get older--only mine didn't. So, he said he cut it off.
It took me a long time to get over the surgury and get my strength back and still to this day it's not as good as my right knee, but ever since the surgury (2003) my knee has not given out on me once.
So, I dont know if that helps or not, but try looking up the 'plica' on the internet and see what you can find! Sorry this was so long...