Isaac Asimov covered this in one of his essays.
Suppose we ask, then, how many years it will take for mankind to increase in numbers to the point where the mass of humanity is equal to the present mass of all animal life? Remember, that when that happens there will be no other life left -no elephants or lions, no cattle or horses, no cats or dogs, no rats or mice, no trout or crabs, no flies of fleas.
Furthermore, to feed that mass of humanity, all the present mass of plant life must be in a form edible to man; which means no shade trees, no grass, no roses. We couldn't afford fruits or nuts because the rest of the tree would be inedible. Even grain would be uneconomic, for what would we do with the stalks? We would most likely be forced to feed on the only plants that are totally nutritious and that require only sunlight and inorganic matter for rapid growth- the one celled plants called algae.
Well then, if the total mass of animal life is two million million tons, log y equals 12.30 and x works out to 466. This means by AD 2436 the last animal (other than man) will have died, and the last plant (other than algae) will also have died.
By AD 2436 the number of human beings on Earth will be forty trillion or over eight thousand times the present number.The total surface of the Earth is equal to about 200,000,000 square miles, which means by AD 2436 the average density of the human population will be 200,000 per square mile.
Compare this with the present density of Manhattan at noon - which is 100,000 per square mile. By AD 2436, even if mankind is spread out evenly over every part of the Earth - Greenland, the Himalayas, the Sahara, the Antarctic -the density of the population will be twice as high everywhere as it is in Manhattan now.
We might imagine a huge, world girdling complex of highrise apartments (over both land and sea) for housing, for offices, for industry. The roof of this complex will be given over entirely to algae tanks containing an ocean of water, literally, and twenty million million tons of algae. At periodic intervals there will be conduits down which the water and algae would pour, to be separated, with the algae dried, treated, and prepared for food, while the water is returned to the tanks above. Other conduits, leading upward, will bring up the raw minerals needed for algae growth, consisting of (what else?) human wastes and finely chopped up human corpses.
Even this is quite modest compared to the earlier suggestions of allowing the human race to multiply till its mass equaled that of the Universe or merely that of the Earth, is quite unbearable. Where would we find any optimist so dead to reality as to actually believe that in a space of four and a half centuries, we can build a planetary city twice as densely populated as Manhattan. - Isaac Asimov
This was supposed to be a cautionary tale. No one was supposed to think that a world completely given over to supporting the maximum number of humans possible was a desirable goal. Only someone hopelessly insane could envision such a goal as being worthy of achieving.