Bad sleeping habit that almost caused me my relationship

Back in my universities days, I was dating a girl I loved so very much mostly because she has a remarkable character. We spent a lot of time together while we were dating. Sometimes I sleep over at her place and sometimes she sleeps over at my place. During this time I noticed something strange about me. When I sleep at night i lift one of my hands up and it stays that way all through till i wake up. This same thing occurs during the day when am sleeping as well as when I am just lying down on the bed. I raise up one hand just like a student who is trying to answer a question in class by putting up his finger. During the day when It occurs I mostly don't realise immediately until a while, and then when I eventually realise, i bring down my hand and will say to myself "what is my hand doing up and how come it could stay that long up without me getting tired or me being aware of it? I had no idea it was happening at night while i am asleep although when I wake up in the morning my hand kinda feels heavy but I didn't know, what was occurring during the day happens at night as well. My girlfriend kept observing me whenever she sleeps over in my house but she said she thought it was nothing serious until the day she had to stay awake watching my behaviour all through the night as I slept. She said to me that I just don't keep my hands up all night but that I also murmur as I sleep. She was so frightened that day and thought I was evil or something. She threatened to break up with me because of what she saw but I pleaded and explained that I have no control over the act and that I only notice it occurs during the day even when I am not asleep but lying down. In the end though my girlfriend stayed with me until we eventually broke up for other reasons and just as the occurrence started, thesame way it stopped. But ever since then I kept wondering what could have caused a thing like that? It is not like I have nightmares or see myself doing something unusual or being in an unusual place while I sleep.