1. A computer implemented method for optimizing energy consumption by a processor, the method to be executed on a computer, the computer including a memory, the method comprising: monitoring workload of said processor; extracting workload history of said processor for a given time interval; creating a plurality of forecasting models based on said extracted workload history; storing said plurality of forecasting models in a repository of said memory; applying a forecasting model from said plurality of forecasting models on said extracted workload history; reiterating the applying step on each of said plurality of forecasting models to obtain a plurality of future workloads predicted by each of said plurality of forecasting models for the given time interval; collating said plurality of predicted future workloads obtained from each of said plurality of forecasting models; computing an error measure of said plurality of predicted future workloads with reference to an actual workload of said processor for said time interval; sorting said computed error measure related to each of said plurality of forecasting models; selecting an appropriate forecasting model among the plurality of said forecasting models based on its least error measure among said sorted error measures for optimizing energy consumption in said processor; generating an appropriate frequency based on said predicted future workloads associated with the selected forecasting model; and generating an appropriate voltage for said processor based on said generated appropriate frequency.