The application provides a memory persistence method and system, and belongs to the technical field of memory persistence control. The method uses a file mapping mode to process memory data persistence. Part of the content of a file is mapped to memory. Modifications made by a program to the part of the mapped memory can be automatically saved to the file. The scheme is convenient for reading and writing, does not need to introduce a third-party tool, and greatly improves development efficiency.