WHEN Ernest Borger decided to leave Germany in 1936, he had two friends living abroad: one in Boston, one in Sao Paulo. The latter made a more convincing case for his city, then a pleasant municipality of little more than a million people, thriving on the coffee trade. So Mr. Borger chose Sao Paulo as the place to bring up his family and start a children's clothing business.Today, his sons run a successful mid-sized company that, like the city itself, has drawn workers from all over the country in search of a better life. And they and their families must deal daily with a megalopolis of 17 million beset by pollution, flooding, and crime, as well as shortages of housing, health care, transportation, and other critical services. In a generation, Sao Paulo has become a fragile fabric of industry, commerce, and the miserably poor, with ever-burgeoning clusters of grey skyscrapers ringed by ramshackle dwellings. Stretching 40 miles north to south, the city is laced with the fumes of traffic-clogged streets and the stench of three biologically dead rivers. "We keep asking [our father] why couldn't he have picked Boston," jokes his son Tomaz. Wilma Domaraski Arantes, the Borgers' secretary, says her commute on the Castello Branco highway has become more and more grueling: "Four years ago it was a straight shot. But now, with Alphaville [a planned suburban community built on the city outskirts], the area is full of people, and lots of firms have moved out here." Along with her husband and two other employees, Ms. Arantes carpools the half-hour drive to the factory in Barueri, a farming town that has been overrun by Sao Paulo's urban sprawl. For decades, growth has been the byword of Sao Paulo, the capital of a state that now accounts for about half of Brazil's $350 billion gross national product. Today a quarter of Brazil's vehicles, or 4.5 million, circulate in the city's streets. Sao Paulo drew entrepreneurs and workers from Europe, Japan, South America, and other regions of Brazil, who together built the continent's biggest industrial center. The city drove a decade of national economic growth in the 1970s, known as the era of the "Brazilian miracle." But growth has become the city's biggest problem. "We spent almost 20 years growing 5 percent [in population] a year," says Eduardo Zahn, an urban planner at the state Subsecretariat for Regional Integration. "No city in the world that grows 5 percent a year can administer itself. It can't produce the infrastructure, the social equipment and public services, the parks, the plazas, the buses, schools, and day care centers at a rate of 5 percent more a year. No public budget can do this, not even with help from the private sector." Some say an individualistic mentality, the product of waves of small farmers who came to the city after World War II, has contributed to the deteriorating quality of life. "There is an immigrant's culture," says Jorge Wilheim, director-president of the Metropolitan Planning Company for the State of Sao Paulo. "Houses are turned inwards, to the inside of the lot. Paulistanos [Sao Paulo residents] think they have to take care of the inside of their homes only. Outside the house is a no-man's land, for which an abstract entity called the city government is responsible. Migration is an individual project which demands a certain aggressivity in a highly competitive field. You d rop anchor and try to conquer to keep the city from expelling you." Thanks largely to lessening migration from rural areas, Sao Paulo is now growing at only 3 percent a year. According to Mr. Wilheim, greater Sao Paulo will have 21 million people by the year 2000, and is likely to stabilize around 25 million in the next 30 years. Already, many planners speak of an existing "macrometropolis" taking in several urban centers clustered around Sao Paulo, whose total population today comes to 22 million - out of a total state population of 34 million. Sao Paulo's urban planners spend most of their time thinking about how to slow city growth and address social and physical infrastructure needs within the limitations of Brazil's serious national economic problems. The municipal Planning Secretariat has adopted the idea of rationing infrastructure, something revolutionary for a city that until now grew on impulse, without regard for river flood plains, the availability of sewage treatment plants, or housing needs, for example. "The idea is to better distribute density over the whole city, instead of having piled-up areas and empty areas," says Maria Lucia Refinetti de Martins, the Secretariat's acting planning director. Her proposal to accomplish this, now under consideration in the city council, would tax developers who build in areas with adequate sanitation and utilities and use that revenue to build infrastructure in areas lacking telephone wires, roads, water pipes, and electric lines. The city government has also adopted a policy to waive building codes for neighborhoods with existing substandard housing, to give residents access to needed utilities and other city services. This is part of a new trend of realism on the part of city administrators, who until now tried to make Sao Paulo behave as if it were a first-world city, instead of the dynamic industrial heartland of a developing country. "Seventy percent of the city is clandestine," notes Ms. Refinetti, who adds that in the city proper, with a population of 11 million, 1 million people live in favelas, or shantytowns, and 3 million live in corticos, or slums. The many problems these Paulistanos face include annual flooding. Last March the beltway road linking the central city to a series of highways fanning out into the state was flooded for a 20-mile stretch, immobilizing the city. The flood was unusually large, but the phenomenon is so common during the summer rainy season that the city stocks a warehouse with supplies to help the hundreds of people whose shacks inevitably wash away in the rain. At the state level, the focus is on drawing business and population away from the capital to smaller cities. State Governor Luis Antonio Fleury Filho has begun a pilot program toward this end, trying to match 35 Sao Paulo auto-parts makers with manufacturing locations elsewhere in the state. One drawback is the current recession, which is discouraging new business investment. Planners also say that Sao Paulo must use and develop technology to fit its own special problems. "Today we collect water and take away sewage much as the ancient Romans did," says Wilheim. "That's very expensive to invest in, when 60 percent of the homes aren't hooked up to the sewage network, only 15 percent is treated, and the rest is thrown in the Tiet [River]. We should look at something like biotechnology."