Resistive random-access memories have attracted significant attention in memory applications while its physical mechanism behind the resistive switching behavior is still unclear. As a key issue, the migration of oxygen vacancies (VO) directly influences the performance of device in the formation and rupture of conductive filaments. In this work, the distance of VO migration is performed as electric field dependent and affected the performance of the device. Sufficient distance of VO migration is essential for formation and rupture of CF completely, leading to ideally SET/RESET transition of the device. According to this mechanism, an enhanced electric field is designed and optimizes the stability of device significantly, which is demonstrated as a promising approach to optimize the properties of device. The investigation is helpful for guiding the designing of device structure.