thanks for writing to us.
a feeling of sudden racing of heartbeat is common if you wake up from a deep sleep suddenly; especially during 1st half an hour of sleep.
history of sudden feeling of lightheadedness
and freezing is not something normal and should be evaluated. there are a number of causes for such conglomeration of symptoms which may be harmless or serious. you need to consult your physician / cardiologist and then act as per their assessment/advice.
feel free to write again with more details like your age, presence of comorbidities, reports of tests conducted on you etc.