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?
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.