- Thread Author
- #1
Hi, I have this code:
On VirtualFree() there is - with the PAGE_NOCACHE option in VirtualAlloc - a heavy cpu-load over more than 10 sec.
Without this option there is only a short peak in the performance graph. But under XP there is no such behaviour.
Code:
// AllocTest.cpp : Defines the entry point for the console application.
//
#include <windows.h>
#include <stdio.h>
int main(int argc, char * argv[])
{
if ( ! SetProcessWorkingSetSize( GetCurrentProcess(), 1024 * 1024 * 1024 * 1.2, 1024 * 1024 * 1024 * 1.2 ) ) {
return -1;
}
void * buffer = VirtualAlloc( NULL, 1024 * 1024 * 1024, MEM_COMMIT, PAGE_READWRITE | PAGE_NOCACHE );
memset( buffer, 1, 1024 * 1024 * 1024 );
getchar();
VirtualFree( buffer, 0, MEM_RELEASE );
return 0;
}
Without this option there is only a short peak in the performance graph. But under XP there is no such behaviour.