I have the same problem with regularity lately. I have noticed that I can take my time completing the workout, and breath heavily before starting reps, to mitigate the effects. This helps the heart pounding as well as the headaches. Since is it toward the end of a rep cycle when it occurs, suggest backing off on the weight slightly to see if it helps. You may have to slow down on increasing weight, too.
its probably lack of oxygen if i dont braeth much but than quickly do exercize i nearly get a headache
Are you breathing during these exercises? What is your pulse? How old are you and do you have a history of smoking or cardivascular disease?