How Photoshop solved working with files larger than can fit into memory

Adobe Photoshop engineering has developed a software virtual memory system to solve the problem of the app exceeding the available amount of RAM. The system manages document data, image data, undo history and state, as well as the working storage for the current command and caches large blocks of data such as brush descriptions. Image data is stored using a mip map representation, a pyramidal set of tiles, providing image data at a range of low to high resolutions. The VM memory is broken up into pages, with each page typically being a multiple of the hardware page size for the device. Scratch files are created to provide disk-based backing for VM pages, stored in the origin private file system. When processing image data, Photoshop iterates over tiles, ensuring that source and destination tiles for the current iteration are in memory and loading them from scratch files as required. The VM is responsible for flushing pages to the scratch files to make room in memory.

To top