In this paper, two recent heuristic optimization algorithms are presented to optimally manage the operation of the microgrid (MG) with installed renewable energy sources (RESs); krill herd (KH) optimization and ant lion optimizer (ALO) algorithms. The first algorithm is used for solving single-objective function represents either total operation cost or total pollutant emission injected from the installed generating units while ALO is applied to solve the multi-objective function of both total operating cost and emission. The problem is formulated as nonlinear constrained objective function with equality and inequality constraints. In this work; the devices installed in MGs are photovoltaic panel (PV), wind turbine (WT), microturbine (MT), fuel cell (FC), battery and grid. Two scenarios are studied; the first one is optimizing MG with installing all RESs within specified limits in addition to grid, while the second scenario is operating both PV and WT at their rated powers. The obtained results are compared with different reported algorithms like genetic algorithm (GA), Fuzzy self-adaptive PSO (FSAPSO) and others programmed like particle swarm optimization (PSO), grey-wolf optimizer (GWO) and whale optimization algorithm (WOA). For first scenario; the proposed KH gives the best optimal cost of 105.94 €ct while the best emission is 420.57 kg, the best optimal cost and emission of 592.86 €ct 339.71 kg are obtained via KH in the second scenario.