Energetics in the growth mechanism of semiconductor heteroepitaxy