How to load (or map) file part maximum size, but fit in RAM on Windows?

前端 未结 1 929
慢半拍i
慢半拍i 2021-01-29 10:52

There is big file. I need fast sort it. I going to process the file by part, that fit in RAM, to avoid/degrees using page file (next step: merge parts). How to use max RAM?

相关标签:
1条回答
  • 2021-01-29 11:21

    You can VirtualLock the pages you want to process. It locks in physical memory the size you need (if there is enough) swapping others to the paging file.

    You can use the GlobalMemoryStatusEx function to determine how much memory your application can allocate without severely impacting other applications.

    So you could map the file and lock the pages you are going to process.

    0 讨论(0)
提交回复
热议问题