Photoluminescence (PL) and optically detected magnetic resonance are employed to study effects of nonstoichiometry during the growth on defect formation in ZnO epilayers grown by molecular-beam epitaxy (MBE). Several defects are revealed via monitoring th