mmap() for large file I/O?

前端 未结 2 1844
再見小時候
再見小時候 2021-01-05 15:28

I\'m creating a utility in C++ to be run on Linux which can convert videos to a proprietary format. The video frames are very large (up to 16 megapixels), and we need to be

2条回答
  •  半阙折子戏
    2021-01-05 15:38

    If your files are 10 GB or more, then don't even think about trying to use mmap() on a 32-bit architecture. Go directly to a 64-bit OS, which should be able to handle it just fine.

    Note that files that are mapped into memory space don't actually consume the same amount of RAM (as the file size), so you won't need to install hundreds of gigabytes of RAM in your machine.

提交回复
热议问题