Head banging during sleep is an example of sleep-related rhythmic movement disorder. It is common in healthy infants and children. A child may repeatedly bang his or her head into the pillow or mattress. Or a child may sit up, banging the back of the head against the wall or the headboard. Another common action is body rocking. A child may rock his or her entire body back and forth, either on hands and knees or while sitting up. Head rolling is also common. This sleep problem tends to be harmless. It occurs as a young child’s brain and body continue to grow and develop. It often begins when a child is about 6 months to 9 months of age. It usually goes away by the second or third year of life.