We study in detail the impact of alloying HfO2 with Al (Hf1– x Al2 x O2+ x ) on the oxide-based resistive random access memory (RRAM) (OxRRAM) thermal stability through material characterization, electrical measurements, and atomistic simulation. Indeed, migration of oxygen atoms inside the dielectric is at the heart of OxRRAM operations. Hence, we performed comprehensive diffusion barrier calculations in HfO2, Hf1– x Al2 x O2+ x , and Hf1– x Ti x O2 relative to the oxygen vacancy ( $V_{o}$ ) movement involved in low-resistance state ( $R_{\mathrm{\scriptscriptstyle ON}}$ ) thermal stability. Calculations are performed at the best level using ab initio techniques. This paper provides an insight on the improved $R_{\mathrm{\scriptscriptstyle ON}}$ stability of our Hf1– x Al2 x O2+ x -based RRAM devices and predicts the degraded retention of Hf1– x Ti x O2-based RRAM measured in the literature. Our theoretical calculations link the origin of $R_{\mathrm{\scriptscriptstyle ON}}$ retention failure to the lateral diffusion of oxygen vacancies at the constriction/tip of the conductive filament in HfO2-based RRAM.