If 5 billion can live comfortably in Texas (1,200 or so sq. ft per person), and Earth’s surface is 752 times larger than Texas, then 3.7 trillion for all of Earth (including oceans with floating cities), would seem to be the maximum.
Huh? You put 5 billion in Texas and the first to be eaten will be the pets, then each other in short order. A cup of water would cause riots.
These analogies are nice...
However, the fact remains, the desirable areas, those can sustain jobs, economies, those that have weather that won't kill you, natural harbors, rivers, good soil and available water are all but full or reserved for crops.