Gravar-mail: Understanding memristive switching via in situ characterization and device modeling