See your doctor. If these episodes are consistent, you may be having heart issues. Rapid changes in position can cause reduction in flow back to the heart that most people can compensate for, but you are not. You might need an echocardiogram to rule out heart issues. You may just be "out of shape" but you need to talk to a doctor to get started on finding out the answers.