Both performance optimization and scheduling of the distributed generation (DG) are relevant implementing an energy management system (EMS) within Microgrid (MG). Furthermore, optimization methods need to be applied to achieve maximum efficiency, improve economic dispatch as well as acquiring the best performance. This paper proposes an optimization method based on gravitational search algorithm to solve such problem in a MG including different types of DG units with particular attention to the technical constraints. This algorithm includes the implementation of some variation in load consumption model considering accessibility to the energy storage (ES) and demand response (DR). The proposed method is validated experimentally. Obtained results show the improved performance of the proposed algorithm in the isolated MG, in comparison with conventional EMS. Moreover, this algorithm which is feasible from computational viewpoint, has many advantages as peak consumption reduction, electricity generation cost minimization among other.