Fast read memory files - memory-mapped file method

1 Introduction
    Windows provides three methods of memory management:
• virtual memory, the most suitable for managing large object or structure array.
• Memory-mapped files, the most suitable for managing large data stream (usually from a file), and share data between multiple processes running on a single computer.
• Memory Stack, the most suitable for managing a large number of small objects.

    Memory-mapped files can be used for three different purposes
• use memory-mapped file system to load and execute. Exe and DLL files. This saves space and page file application startup time required to run.
• You can use memory-mapped files to access data files on the disk. This allows you to not have to perform I / O operations on the file, and may not cache the file content.
• You can use memory-mapped files so that multiple processes running on the same computer to share data between each other. Windows does provide some other means, for data communication between processes, but these methods are using memory-mapped files to achieve, which makes memory-mapped files into multiple processes on a single computer to communicate with each other in the most effective method. 

 

Reference blog:

  Description: https://blog.csdn.net/wcyoot/article/details/7363393

  Test: https://www.cnblogs.com/TenosDoIt/p/3157596.html

  c ++ handling of large files

  Large file operations (eg: 4G)

  VC ++ reading and writing large files (larger than 4G)

 

Guess you like

Origin www.cnblogs.com/icmzn/p/11118612.html