How to programmatically force hard page faults?
From: ohaya (ohaya_at_cox.net)
Date: Mon, 27 Sep 2004 20:55:07 -0400
I hope that this is an appropriate newsgroup for my question. I looked
around, but this seems to be the closest.
I have a somewhat unusual request:
I'm trying to write a program that will force hard page faults over a
sustained period of time.
The reason that I'm trying to do this, is that I'm doing some testing of
a new system, and am trying to determine how it reacts to hard page
faults under certain circumstances.
I've put together a small C++ program that basically loops and does
'new', e.g., something like:
char * p = new char;
x = p;
The above code does trigger lots of page faults, but when I monitor Page
Reads/sec with Performance Monitor, it is showing 0, i.e., it looks like
all the faults are soft page faults.
Sorry if this is a somewhat strange request, and thanks in advance!