Patent ID: 8756383

Claim:
A method, comprising: maintaining, by a memory duplication agent executed by a processing device of a host machine, a secondary data structure representing a plurality of memory pages managed by the memory duplication agent, wherein each of the plurality of memory pages are divided into a plurality of blocks of identical length; determining, by the memory duplication agent, an index of a received new memory page by: selecting a plurality of offsets corresponding to the plurality of blocks from the new memory page, wherein the offsets are randomly selected, and consistent for each of the plurality of memory pages indexed in the secondary data structure; and generating the index for the new memory page utilizing the selected plurality of offsets; comparing, by the memory duplication agent, the index of the new memory page with the indices of the secondary data structure for a match; in response to finding a match in the secondary data structure, utilizing, by the memory duplication agent, a main data structure of the memory duplication agent to perform a full page memory comparison with the new memory; and updating, by the memory duplication agent, at least one of the size of the blocks, the number of blocks, or the offsets of the blocks used to index the memory page upon the occurrence of at least one of a triggering security event or a time interval.