System Memory Access
Performance Inspector supports access to system (kernel) memory.
"Steals" memory by locking (pinning) it in the kernel so the system can't page it out (as
it could if the memory was locked at ring 3 using VirtualAlloc()/VirtualLock()).
int StealSystemMemory(UINT32 size);
- Number of bytes to steal (lock). Minimum amount is 4KB (one page) and size should be
in multiple of pages.
- Memory stolen successfully.
- Error. Kernel resources exceeded or out of memory.
If you don't know what you are doing don't use this API.
The driver maintains a list of "stolen" memory chunks.
There is a limit of 16K chunks (i.e., 16K successful calls to StealSysemMemory()).
Minimum amount stolen is one (1) page (4KB).
Chances of success are better if requested size is "small". If you want 250MB locked you
are better off issuing multiple "smaller" requests adding up to 250MB.