As current memory technologies approach their fundamental limits, increasing demand for novel non-volatile memories is driving the development of new architectures, which are already showing their potential in high performance computing [1, 2]. As a result of their non-volatile nature, byte-addressability and fast response times, which are comparable to those of dynamic random-access memory, resistive-switching-based phase change materials (PCMs) are strong candidates for memory applications with reduced hardware cost and power consumption [3, 4]. The use of advanced transmission electron microscopy combined with in situ electrical biasing provides a powerful method for studying the local relationship between atomic structure and electrical properties in individual nanoscale memory elements, in order to identify the factors that affect their switching reproducibility and dynamics. We have developed a multi-step lithographic procedure, which allows dedicated nanostructured line cells that containPCM switching layers, electrical contacts and protective layers to be fabricated directly on electron-transparent silicon nitride membranes and used for switching experiments both outside and inside the transmission electron microscope. We used a special electrical setup to provide short (50 ns) electrical current pulses to individual line cells with sharp (approximately 3 ns) rising and falling edges. By using these pulses, PCM devices could be switched between crystalline low resistance and amorphous high resistance states inside a transmission electron microscope. Even though each device consisted of several layers of different materials, resulting in a total thickness of between 200 and 300 nm, a fast pixelated direct electron detector could be used to record scanning electron diffraction patterns from amorphous/crystalline regions before and after successive switching cycles, while measuring the electric properties of the same devices. Newly-developed algorithms based on LiberTEM software  were used to follow the evolution of individual crystallites and to show that the switching mechanisms involved slow crystal growth or rapid recrystallization, depending on the details of the current pulses.  K. Wu, F. Ober, S. Hamlin and D. Li, ArXiv:1708.02199 [Cs] (2017).  Y. Zhang and S. Swanson, 31st Symposium MSST (IEEE, Santa Clara, CA, USA, 2015), pp. 1-10.  T. Coughlin, IEEE Consumer Electronics Magazine 5, 133 (2016).  S. Chhabra and Y. Solihin, 38th Annual ISCA (2011), pp. 177-188.  A. Clausen et al. LiberTEM/LiberTEM: 0.5.0. (Zenodo, 2020). doi:10.5281/zenodo.3763313.