Optimization Theory of Large Systems