In March, the UN revised its projected world population for 2050 downward to about nine billion - right at the demographic point most experts predict that we will run dry of fresh water. Nearly all those extra three billion people will be born in the developing world. On the other hand, with HIV infection rates as high as Botswana's 38.5 per cent, one in four Africans is expected to die of Aids. Below-replacement-rate fertility levels in Europe are set to stress healthcare and pension systems. Indeed, the average number of children born to a European woman during her lifetime is now only 1.4, manifesting pasta-free visions of Italy without the Italians. So what's the story? Are we multiplying like bunnies, or dropping like flies?
In demographic terms, for more than a century westerners have seemed unable to decide what they fear most. The precipitous drop in European fertility rates has produced anxiety about numerical dwindling, latterly echoed among whites in the US. Yet the sixfold increase in worldwide population during the same period has prompted a contrary fear of crushing biological overload. Given the emotive nature of these opposing horrors - "we are about to disappear!" v "we are being overrun!" - it is less surprising that population issues have filtered into the western literary canon than that their direct treatment in mainstream literature is so rare.
Prospective human extinction has inspired a raft of commercial fiction. As a rule, thrillers such as Michael Crichton's The Andromeda Strain are satisfied with sacrificing a handful of cautionary unfortunates before catastrophe is averted, while science fiction gleefully smites millions of walk-ons with no guarantee of a happy ending.
The nature of the catastrophe often expresses the prevailing angst of the era. E M Forster's story "The Machine Stops" reflects anxieties about automation: a machine that tends to every human need creates a race of biological incompetents, like domesticated pets; when the machine breaks down and no one understands how it works, the species is finished. Subsequent science-fiction authors have also demonised dependence on technologies, extrapolating social disaster when metal, electricity or plastic cease to function. Novels such as John Christopher's No Blade of Grass and J G Ballard's The Burning World convey concerns about food and water supply, others (take Christopher's The Long Winter) anxieties about global temperature shift. But fictional apocalypse comes in a festival of more inventive guises: volcanic gas, planetary collision, infectious insanity and extraterrestrial wasps.
During the cold war the most common threat to the human race in bookstores was bellicosity. The spectre of nuclear holocaust gave rise not only to death-ray shoot-outs in outer space, but to realistic accounts like Neville Shute's mournful On the Beach (humanity's last remnants in Australia await an approaching cloud of nuclear fallout), as well as to witty satires like Kurt Vonnegut's Cat's Cradle (all water crystallises into "ice-nine").
With fears of the bomb receding and Aids in ascendance, plague novels have become more the vogue. In a seminal work of this subgenre, George R Stewart's Earth Abides, a young man in California recovers from a snake bite, only to find most of the human race dead from a new virus. As the handful of immune survivors form an ad hoc community, depopulation has some kid-in-a-candy-store appeal; houses, groceries and liquor are free and abundant. But as Stewart tracks three post-plague generations, he vividly demonstrates that advanced civilisation depends on numbers. Reduce the race to the size of a small town and how many residents will remember how to make plastic? The last Americans plunder canned goods (with little respect for sell-by dates), and literacy atrophies; electrical and water systems break down. At length, the community reverts to its hunter-gatherer forebears.
The emergence of HIV, the threat of biological weapons and the multiplication of disease vectors via globalisation make epidemiology more than physics the black art of the age. At least on paper, expect more plague.
In the literature of population decline, peril makes people seem precious. The same cannot be said of the literature of population excess, in which two may be company but 30 billion is a crowd.
Kurt Vonnegut's playful story "Tomorrow and Tomorrow and Tomorrow" extrapolates what life might be like if "anti-gerasone" keeps folks alive for as long as they care to stick around. In a world of 12 billion, families of several generations live on top of one another, and the irritable 172-year-old Gramps tyrannises his relatives with threats of disinheritance should he ever kick his own bucket. Taxed to penury to finance pensions, the youthful 112-year-old protagonist wails to his wife: "I don't think we're ever going to get a room to ourselves or an egg or anything."
With average western lifespans climbing, its elderly cohorts swelling, and genetic research into the arrest of aging making headway, Vonnegut's premise becomes less fanciful. Likewise, Simone de Beauvoir's novel All Men Are Mortal, in which a 14th-century Italian takes a drug to induce immortality only to discover that by the 20th century his existence is boring, lustreless and oppressive. While medical science still cannot offer eternal life, de Beauvoir's thesis - that brevity is one key to life's sweetness - suggests that great efforts lavished on longevity might be misspent.
Mainstream treatments of population excess are few. Because most authors define an "overpopulated" world as one more crowded than their own, the issue is often consigned to futuristic science fiction - with titles like Make Room, Make Room, Disposable People and Population Doomsday.
Overabundance in science fiction reliably cheapens humanity into chaff; cannibalism is a running theme. Civil liberties are eroded, and small, protected elites often control the seething horde through fascistic or mechanistic means. Drab, mass-produced garments portray a loss of individuality; quality of life plummets. Food runs to tasteless seaweed pellets; drink may be available, but only rotgut (writers seem especially distressed by the prospect of no longer being able to get a decent bottle of wine). Living space is at a premium, domestic architecture dismal, but never fear: these swarming dystopias are reliably years off.
By contrast, my own more mainstream Game Control is set in modern-day Nairobi. Its irascible protagonist is the fanatic demographer Calvin Piper, who is convinced that we are reproducing ourselves into extinction, and is therefore researching a pathogen that would neatly decimate a third of the world's population overnight. But Calvin is a self-professed misanthrope, and his motivation is thoroughly suspect. Indeed, he finally comes to recognise the illogic of going to so much trouble to save a race he detests.
Anthony Burgess's The Wanting Seed - like Game Control, more social satire than science fiction - exemplifies how overdoing "fruitfulness" leads to biological perversity and moral inversion. In his anti-natalist Britain of the near future, homosexuality confers prestige ( "It's sapiens to be homo"); parenthood, shame. While in George Orwell's 1984, sham wars create social cohesion, here they are staged as a means of population control. When the state's iron control breaks down, wholesale cannibalism ensues.
Yet these high-density nightmares are usually uncomplicated by race, which lends them a certain innocence. The same cannot be said of Jean Raspail's The Camp of the Saints (1973), a novel both prescient and appalling. It is the year 2000, and Raspail's population projection of seven billion worldwide turned out to be close. Resentful and wretched, 800,000 residents of Calcutta swarm on to a fleet of ships and steer the convoy toward the coast of France. As the rutting, reeking, hate-driven throng approaches, the liberal, multicultural France prepares to greet her "visitors" with open arms. Meantime, resident immigrants, despising their menial jobs, constitute a waiting fifth column. By the time the ships run ashore - and the first landing party is a tide of bloated corpses thrown overboard - similar seajackings have occurred elsewhere, and the full-scale invasion of the first world by the third world has begun.
Certainly The Camp of the Saints is racist. Raspail's stinking "river of sperm" floating toward France is dehumanised, its mascot at the prow a speechless deformed dwarf. Yet it's a tough call whether Raspail is more disgusted by "the sweating, starving mass, stewing in urine and noxious gases" or by his own countrymen, who are too paralysed with self-contempt to defend their borders: "Cowardice toward the weak is cowardice at its most subtle, and indeed, its most deadly." And to give the novel its due, it is written with tremendous verbal energy and passion.
Raspail gives bilious voice to an emotion whose expression is increasingly taboo in the west, but that can grow only more virulent when suppressed: the fierce resentment felt by majority populations when that status seems threatened. Moreover, the developing world migration pressures that Raspail foresaw are indeed being brought to bear, as squalid human trafficking proliferates and hundreds of asylum-seekers nightly storm the Channel Tunnel at Calais, often bringing rail services to a halt. If The Camp of the Saints contains a lesson, it is that majority concerns about immigration need fair airing, for such primitive anxiety is too potent to be consigned solely to the far right.
Broadly, demography is a lightning-rod for literary reservations about humanity itself, which can appear repulsive in sufficient quantity, or even seem to deserve its fate when bringing extinction upon itself. Alternatively, fiction can animate the humanitarian truism that, biologically, we all sink or swim together. This collective existential ambivalence helps to express the dichotomy that other people are at once resource and rival: we need social co-operation to survive, yet our fiercest competition for that survival comes from our own kind. Beneath the field's dry statistical surface, there teems an irresistible Pandora's box of paranoia, nationalism, racism, rivalry, misanthropy and apocalyptic dread. Consequently, demography is sure to tempt more fiction-writing dabblers to prise open the lid.
Lionel Shriver is an American writer living in London. Game Control is published by Faber and Faber (£6.99)