Van der Waals heterostructure based on layered two-dimensional (2D) materials offers unprecedented opportunities to create materials with atomic precision by design. By combining superior properties of each component, such heterostructure also provides possible solutions to address various challenges of the electronic devices, especially those with vertical multilayered structures. Here, we report the realization of robust memristors for the first time based on van der Waals heterostructure of fully layered 2D materials (graphene/MoS2-xOx/graphene) and demonstrate a good thermal stability lacking in traditional memristors. Such devices have shown excellent switching performance with endurance up to 107 and a record-high operating temperature up to 340oC. By combining in situ high-resolution TEM and STEM studies, we have shown that the MoS2-xOx switching layer, together with the graphene electrodes and their atomically sharp interfaces, are responsible for the observed thermal stability at elevated temperatures. A well-defined conduction channel and a switching mechanism based on the migration of oxygen ions were also revealed. In addition, the fully layered 2D materials offer a good mechanical flexibility for flexible electronic applications, manifested by our experimental demonstration of a good endurance against over 1000 bending cycles. Our results showcase a general and encouraging pathway toward engineering desired device properties by using 2D van der Waals heterostructures.