my husband grew out of this the year he moved in with me, 
According to MiL he always did it, when he and I got together, I use to just put my hand on his head say no and rub his back, it was either that or wake him, then he would only start again, eventually he gave it up, hasn't' done it for twenty years now,
try the hand on the head, and back rub let me know how you get on, as I have always wondered if it would of helped as a baby/child,
the only time it ever appeared after he had stopped, was in times of real stress, but he has now given it up,
his was quite violent, I was really scared he was hurting himself, he had no idea he was doing it, he knew did do it, as family, and friends had told him, you could hear the thuds, rooms and floors away,
I think it's a habit forming, and hard to break, partly because they are unaware, and partly because it is a comfort, it sort of overwhelms them,
for the sake of his future girlfriend/ wife and brain cells please try to break the cycle,
a friend's child who did this made the cot collapse, so keep checking those fixing.