X-ray photoelectron spectroscopy, extended X-ray absorption fine structure spectroscopy (EXAFS), X-ray absorption near edge structure (XANES) spectroscopy, spectral ellipsometry, and quantum-chemistry calculations are used to examine the atomic and electronic structure of nonstoichiometric amorphous ZrOx slightly enriched with zirconium. The experimental data show that the ZrOx material consists of stoichiometric ZrO2, metallic Zr, and zirconium suboxides ZrOy. A model of nanoscale spatial potential fluctuations in ZrOx is substantiated. In this model, the potential fluctuations for electrons and holes arise due to the local bandgap energy fluctuations in the range from 0 to 5.4 eV. A ZrOx-based flash memory element with giant retention time is proposed.