I have recently been sleeping with my knees up, too. Incidentally, it all began when I needed to leave graduate school and move back home to take care of my father who was dying from cancer. For 2-3 months I was living at home and basically spending my time in sitting positions, i.e. while sitting with my dad watching movies, spending time with him (he was bedridden at that point), and whenever I wasn't with him I'd just be sitting at my computer or watching tv on the couch. I didn't really go out or spend time exercising. To make matters worse, when I'd go to sleep I would put a pillow under my knees, as it just wasn't comfortable for me to sleep with my legs straight.
After my father died, I moved away to live with my boyfriend and I told him that it was uncomfortable to sleep with my legs straight. A week later he tells me that he will wake up and see me sleeping with my legs bent. This threw me off because I had never done that before. It also disturbed me because when I was back home with my father, he would always be laying there on the bed with his knees bent. My family would tell him that he needed to stretch his legs out in order to prevent cramping, but that was very painful for him to do. He was suffering from cachexia (wasting away) already, so his muscles were atrophying.
It never occurred to me that perhaps I was going through this too..that my muscles were shortening. I only realized this when my boyfriend told me that I probably have been sleeping like this because my hamstrings were shortening, from sitting all day and not walking around/exercising. He also said that if I were to let this continue to happen I would eventually develop lower back problems. No idea where he learned this from but that is why I love him! :) We are both biology majors but I don't remember learning this specifically from anatomy/physiology, but he does do a lot of martial arts and weight lifting. But it does really make sense if you think about it.
Basically our muscles adapt (in this case atrophy/shorten) because our bodies want to conserve energy. It costs a lot of energy to maintain muscle, and if it is not in use, why should our bodies work to maintain it? I looked up "hamstring shortening" on the web and found this website, which gives a good explanation: http://www.magicalrobot.org/BeingHuman/2011/03/office-ergonomics-why-sitting-will-kill-you.
I don't know if this is what everyone is suffering from, but hopefully for some it will explain what is going on. With the elbow-bending, it could also be the same thing, just with your biceps experiencing the same shortening (sitting in front of computer or doing activities with your arms bent somehow). What I would suggest is to simply do a bit of walking and stretching every day at the very least and to conscientiously try to sleep with your legs straight. Do NOT sleep with a pillow under your knees as this will exacerbate the problem!
Btw, I'm a gemini. Just wanted to put that in there ^ ^