A method for generating a memory snapshot of a virtual machine, comprising: for all memory pages of the virtual machine in sequence, with S=1..N, and N being an actual page quantity of the virtual machine, obtaining a current S th memory page of the virtual machine; identifying a page type of the current S th memory page, wherein the page type comprises an invalid data page and a valid data page; and recording the page type of the current S th memory page in a memory snapshot file when the current S th memory page is an invalid data page; and recording the page type and page data of the current S th memory page in the memory snapshot file when the current S th memory page is a valid data page; wherein the identifying a page type of the current S th memory page specifically comprises: determining the page type of the current S th memory page according to page type information stored in virtual machine monitor, VMM memory space, wherein the page type comprises a balloon page, a populate-on-demand page, a share page, a swap page, and a common page, wherein the balloon page and the populate-on-demand page are invalid data pages, and the share page, the swap page, and the common page are valid data pages; or wherein the identifying a page type of the current S th memory page specifically comprises: determining the page type of the current S th memory page according to page type information stored in VMM memory space, wherein the page type comprises a balloon page, a populate-on-demand page, a share page, a swap page, and a common page; and when the page type of the current S th memory page is a common page, traversing content of the current S th memory page, and determining, according to a traversal result, that the page type of the current S th memory page is a zero page or a non-zero page, wherein the balloon page, the populate-on-demand page, and the zero page are invalid data pages, and the non-zero page, the share page, and the swap page are valid data pages. for all memory pages of the virtual machine in sequence, with S=1..N, and N being an actual page quantity of the virtual machine, obtaining a current S th memory page of the virtual machine; identifying a page type of the current S th memory page, wherein the page type comprises an invalid data page and a valid data page; and recording the page type of the current S th memory page in a memory snapshot file when the current S th memory page is an invalid data page; and recording the page type and page data of the current S th memory page in the memory snapshot file when the current S th memory page is a valid data page; wherein the identifying a page type of the current S th memory page specifically comprises: determining the page type of the current S th memory page according to page type information stored in virtual machine monitor, VMM memory space, wherein the page type comprises a balloon page, a populate-on-demand page, a share page, a swap page, and a common page, wherein the balloon page and the populate-on-demand page are invalid data pages, and the share page, the swap page, and the common page are valid data pages; or wherein the identifying a page type of the current S th memory page specifically comprises: determining the page type of the current S th memory page according to page type information stored in VMM memory space, wherein the page type comprises a balloon page, a populate-on-demand page, a share page, a swap page, and a common page; and when the page type of the current S th memory page is a common page, traversing content of the current S th memory page, and determining, according to a traversal result, that the page type of the current S th memory page is a zero page or a non-zero page, wherein the balloon page, the populate-on-demand page, and the zero page are invalid data pages, and the non-zero page, the share page, and the swap page are valid data pages. determining the page type of the current S th memory page according to page type information stored in virtual machine monitor, VMM memory space, wherein the page type comprises a balloon page, a populate-on-demand page, a share page, a swap page, and a common page, wherein the balloon page and the populate-on-demand page are invalid data pages, and the share page, the swap page, and the common page are valid data pages; or wherein the identifying a page type of the current S th memory page specifically comprises: determining the page type of the current S th memory page according to page type information stored in VMM memory space, wherein the page type comprises a balloon page, a populate-on-demand page, a share page, a swap page, and a common page; and when the page type of the current S th memory page is a common page, traversing content of the current S th memory page, and determining, according to a traversal result, that the page type of the current S th memory page is a zero page or a non-zero page, wherein the balloon page, the populate-on-demand page, and the zero page are invalid data pages, and the non-zero page, the share page, and the swap page are valid data pages.