1. One or more non-transitory computer-readable storage mediums storing one or more sequences of instructions, which when executed by one or more processors, cause: identifying a set of pages of memory that have the same content (a) as stored on disk and (b) as stored in a guest physical frame, wherein each of the set of pages of memory are stored by two or more virtual machines; storing mapping data that identifies a two-way mapping between the locations of where each of the set of memory pages is stored on disk and in the guest physical frame of a template virtual machine; consulting said mapping data to identify blocks in a page file that correspond to said set of memory pages; and removing said identified blocks from said page file to conserve space on said disk.