The optimal ecological performance of a Newton's law generalized irreversible Carnot engine with losses due to heat-resistance, heat leak and internal irreversibility is derived by taking an ecological optimization criterion as the objective. This consists of maximizing a function representing the best compromise between the power and entropy production rate of the heat engine. A numerical example is given to show the effects of heat leakage and internal irreversibility on the optimal performance of the generalized irreversible heat-engine.