If you're writing a science fiction (or other *) novel and want to show how thousands of people can live in small spaces in cities due to overcrowding, etc., it's a good idea to see how people today manage. And it's quite remarkable.
Nathan Bransford mentioned Kowloon, the illegal walled city of Hong Kong in his post, which reminded me of some videos I saw months back. Here's the first part of a German documentary (with English subtitles) about the city.
Here's a video about a Hong Kong architect, who designed his own home which transforms a small space into whatever room he needs.
Here's a video about the kinds of furniture you can buy that makes small space living possible.
And for some complete foldaway rooms when you really don't have the space:
*I encountered my first fold up bed at one of the farm houses at the Open Air Museum in Holland.
In early medieval times the great hall where people feasted was also the bedchamber afterwards (bedrooms being more modern inventions). And the Japanese of the same era had movable walls in their houses and the furniture constantly changed location. Even today most Japanese put their mattresses (futon) away and their bedrooms become living areas.
Small space living isn't new, and people continually get more creative about how to survive in the space they have.