One option for heat recovery and decrease in consumption of fossil fuel burning in order to power generation and mitigation the carbon dioxide (CO2) emission in the atmosphere is the application of heat recovery steam generator (HRSG). It is studied here from viewpoints of techno-economic analysis, process optimization, and environmental impact. This paper is focused on the design of an HRSG, aiming to optimize the plant efficiency in gasoline-kerosene units, Tabriz petroleum refinery, Iran, through heat recovery from the exhaust (flue) gases of the furnaces’ stacks in these units. Heat transfer and pressure drop calculations are done based on a methodology of maximizing the value of profit in terms of the approach points in the HRSG. The results showed that the HRSG in its optimum design can generate steam (42 bar and 390 °C), with a maximum profit of 6,650,000 $ during a period of 10 years operation with a temperature of 210 °C for flue gases exiting the HRSG at approach point of 14.3. Moreover, applying the steam generated by the HRSG in the plant, it can be saved 1500 kg/h natural gas from burning which decreases from emitting a considerable amount of CO2 in the atmosphere.