Virtual memory is simulated memory that is written to a file on the hard drive. That file is often called page file or swap file. It’s used by operating systems to simulate physical RAM by using hard disk space. To understand how virtual memory works we have to go back in time, before virtual memory even exited.