The city’s millions of residents are crammed together, competing for space to live, play, work and rest.