Hmm, so if I understand correctly, your problem is that you eventually end up with starving citizens and famine? Granaries won't help that - all Granaries really do is help your city grow faster through foodbox filling - and that isn't exactly the most common form of pop growth
In Civilization, a city generally won't grow to the point where it has famine until late in the game, when everything's all farmed out and it's a hunger of 1 which can be easily fixed with 1 food caravan. Usually, city growth stops when the food runs out. The only things I can think of that you might be doing that cause early hunger and famine would be:
1) Building a lot of settlers (not a bad thing!) but switching to Republic, Communism, Fundamentalism, or Democracy before sufficent terrain improvement has been done. That kind of switch will instantly double food upkeep for settlers, which can hit a city hard if it's not ready. Even one settler in these governments can slap a size 1 or size 2 city into instant hunger if the city's not built on a grassland or 3+ food special, or doesn't have a 3+ food special within easy reach.
2) Building cities on mountains or other bad terrain. Don't do this. Making cities on Swamps, Jungle, or Forest is slightly less bad, since a settler can change the terrain within a reasonable amount of time. Stay off Tundra, Desert, and Mountain - it's not worth it, you won't be able to change the terrain until Explosives and engineers. Mountain particularly, since it'll only be good after 50 engineer-turns of transformation.
3) Sending too many food caravans to another city. I don't know why you might do this, but it is a possible reason.
If you're talking about late game and those size 38-40 cities with one hunger, just don't farm one square or patch it up with a food caravan from a city that also has 1 hunger. The sending city will get hunger 2, eventually lose a citizen and stabilize at no surplus, while the receiving city will get one food and stabilize as well.
-Sev