Optimizing the Energy Consumption of Large-Scale Applications