An excessive unintentional out-diffused In atom into the switching layer is a potential threat to the switching stability of memristor devices having indium tin oxide (ITO) as the electrode. We suggest that the physical factor (bombardment of Ar ions and bombardment-induced localized heat during ZnO deposition) and chemical factor (bonding dissociation energy, point defects, and bond length of atoms) are responsible for promoting the out-diffusion. The In atom acts as dopant in the ZnO lattice that degenerates the ZnO insulative behavior. Furthermore, the In ions take part in the conduction mechanism where they may compete with other mobile species to form and rupture the filament, and hence, deteriorate the switching performance. We propose a facile UV/O3 (UVO) treatment to mitigate such damaging effects. The device fabricated on the UVO-treated ITO substrate exhibits significant switching parameter improvement than that of the device manufactured on untreated ITO. This work delivers an insight into the damaging effect of out-diffusion and auto-doping processes on the reliability of memristor devices.