Another example is Isaac Asimov's Trantor, a world-wide city enclosed with globes which requires the resources of multiple agricultural worlds to sustain it. It has a population of 45 billion, and a surface area of approx. 40% that of Earth.
Do the calculations, and the population density is, as Wikipedia says: "similar to the current population density of Germany or Connecticut. " I can't speak for Connecticut, but Germany certainly doesn't feel crowded. Even in central Berlin we have a huge amount of green space.
Even Coruscant in Star Wars, with a population of 1 trillion people (1 000 000 000 000) has a population density less than New York City.