Earlier this evening I contributed to the thread "A Gnawing Feeling In My Stomach" in this same forum, and I talked about gastritis as a cause for the problem discussed in that thread:
http://www.typologycentral.com/forums/health-fitness/36689-gnawing-feeling-my-stomach.html
Then I just saw this thread about insomnia and noticed a couple of the posters talking about waking up 3-4 hours after going to sleep. Usually when I think of insomnia, I think of people who have trouble getting to sleep at all. But when people are getting to sleep okay but waking up after 3-4 hours of sleep, I know that that can sometimes be a symptom of an irritable stomach (gastritis).
Specifically, gastritis is overproduction of gastric acid leading to irritated stomach lining. Gastritis tends to be worst when the stomach is empty--the gastric acid eats at the stomach lining. When most people go to sleep they still have some food on their stomach from dinner. But slow digestion continues during sleep, and after about 3-4 hours of sleep everyone's stomach becomes empty. At that point gastritis sufferers tend to have an attack of sour stomach and irritation. The result will be poor sleep for the remainder of the night or an inability to sleep more than 3-4 hours.
A snack of bready food can help--the food will soak up the excess acid and soothe the stomach lining by putting some food on it. As a result you get the infamous 2 am snack with sleepwalkers raiding the fridge. But of course a longer-term fix would be to address the gastritis directly.
If you wake with a mild case of gastritis, your stomach may feel vaguely irritable/hungry/empty; due to the acid and upset you may wake up feeling pretty alert or even a bit hyper. Of course, gastritis is only one of several possibilities for an inability to sleep more than 3-4 hours. Still, it's worth checking. Basically, like I said, this kind of insomnia can be an early indicator for gastritis; by the time gastritis sufferers make it to the doctor, they often have longstanding sleep problems. (Later indicators would be gnawing in the stomach or physical pain, as in the thread I mentioned.)
If you want to experiment, then take 150 mg of Ranitidine (generic for Zantac) at bedtime (and at least 1 hour after any food). If you wake up in the middle of the night, take a sizable shot of a liquid antacid with aluminum hydroxide and magnesium hydroxide, like Mylanta or Maalox. All these drugs are all sold over-the-counter at drugstores and even at supermarkets in the drug aisle. Try this regimen for a week or so (so as to give your sleep habits a chance to adjust accordingly).
Some background: PPIs and H2 blockers like Zantac (Ranitidine), Pepsid, Nexium, Prilosec, etc. suppress acid production at the source and are for longer-term relief (they work for 6-8 hours.) Antacids with aluminum hydroxide and magnesium hydroxide, like Mylanta or Maalox, neutralize any acid physically present in your stomach, giving you immediate/short-term relief.
I'm not a physician; check the literature that comes with the drug or check their websites on the net if you have any concerns about interactivity with other drugs you might be taking.