Just to add. You say it can go on for about three hours. If this is due to the heart, I don't think you would experience it this long if eating is the cause. Once emptied from vomitting, the stomach calms down and requires less oxygen and the heart relaxes. I had this problem with my heart attacks. Everytime I ate something, within 5 mins I was sweating with pain in the chest and vomitting. It lasted about 15-20 mins and then stopped. I wouldn't have another attack unless I ate something. Walking caused a really tight throat which was confused as heartburn by my GP for a year.
Are you sitting in a chair when this happens, or exerting yourself? If it's heart related it would normally appear on exertion, then when you relax in a chair it diminishes. Eating
can cause the same load as exertion when you are sitting down because a much higher blood supply has to be sent to the gut for digestion. The pains, if heart related from eating, should occur within 5-10 minutes of eating. Do you sweat with the pain? do you feel light headed? do you feel pains anywhere else?
If you can walk for 30 mins with no strange discomforts then I doubt if this is heart related. You may need to swallow a scope and see what's going on in your gut. I would get to your GP, it could be an ulcer or something. Maybe you eat certain foods at times which aggrevate it.