开发者

Preventing Windows from paging some data

开发者 https://www.devze.com 2022-12-09 05:51 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消