DETROIT ‚?? General Motors earned its largest profit ever in 2011, two years after it nearly collapsed. Strong sales in the U.S. and China helped the carmaker turn a profit of $7.6 billion, beating its old record of $6.7 billion in 1997 during the pickup and SUV boom. GM is a vastly different company than it was back then. It‚??s smaller, has less debt and its contract with the United Auto Workers is less costly. But it took a $49.5 billion government bailout and bankruptcy protection in 2009 to cut its bloated costs. The company earned a huge profit even though U.S. car and truck sales were near a historic low of 12.8 million. In 2012, GM expects to increase its revenue as global sales grow and it charges more for models. Its ongoing effort to cut costs and take advantage of its global presence are also paying off. In the fourth quarter, costs fell by $500 million. It saved $100 million by cutting some of the dozens of advertising agencies and media managers it uses. It also saved $100 million by centralizing engineering. Late Wednesday, GM said it would freeze its U.S. pension plan for longtime white-collar workers and give all salaried employees annual bonuses but not pay raises. That‚??s good news for the U.S. government, which still owns 26.5 percent of the company and needs the stock price to rise significantly before it can recoup all the bailout money. Still, problems emerged for GM late last year. Its fourth-quarter profit fell 8 percent and missed Wall Street expectations.