Hi,
not a driver question, but here are the right people to ask! I have a few questiosn regarding the new PrefetchVirtualMemory() function starting its availability with Windows 8. Currently i dont have a system to investiagte on the function
http://msdn.microsoft.com/en-us/library/hh780543(VS.85).aspx
I guess this function can be really of use for applications that will do some read-ahead prefetching of memory that will (possibly) be “used” in some way on later usage. As the documentation says, there can be advantages on it, so that the “function can provide performance improvements by issuing a single large I/O rather than the many smaller I/Os that would be issued via page faulting”. From here all is clear to me so far. But here are my questions i would politely like to ask:
The documentation says: “The prefetched memory is not added to the target process’ working set; it is cached in physical memory”
- Does this block of memory have some “expiration date” where it will possibly be freed/invalided since its not really used and touched in some way, just staying ready to be used, or do the well know rules of windows memory management work here? What exactly is meant by “physical memory”? Is it real physical memory, or does this include pagefile paged-out memory as well? Will the cached memory be paged at some point. e.g. more memory needed? Can this cached memory be freed manually in some way? Is this memory shared in some way among processes/windows so other processes can use a “copy” of it without doing e.g. a disk/media hardware access or is it only accessible for the calling process?
Again the documentations says: “…and is subject to usual physical memory constraints where it can completely or partially fail under low-memory conditions. It can also create memory pressure if called with large address ranges,…”
- What exactly is meant by “partially fail”? Does this mean the function will fail at some point and return some error code (possibly a 299/0x12b) and stop processing the VirtualAddresses-Array passed to the function, or will it skip the “failed” parts/addresses passed with the VirtualAddresses-Array parameter and keep on processing the array elements until its finished? WIll it then possibly return something like 299/0x12b? What happens if the function hits a PAGE_NOACCESS or PAGE_GUARD protected memory block passed in the VirtualAddresses-Array?
Thanks in advance…
K.