简体   繁体   中英

Preventing Windows from paging some data

I have a large block of data in memory that I don't want Windows to page. The memory is a cache of a section of data that can be reconstructed from files on disk. The cache is meant to completely prevent hard drive accesses as long as enough memory is available, so it's worthless to me if Windows starts paging it. Instead of paging, I would like my application to simply free the memory if required ( as mentioned in this post ).

Is there any way to allocate a block of memory as non-pagable?

VirtualLock() is probably what you are looking for. Raymond Chen has some more info in it here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM