I am working on a system with 4GB ram . I created a large file of 4GB and initialized it with zeros.
I started reading the large file integer by integer.
I find that the number of page faults (major) is zero, no matter how big is the file.
I read the file using both a FILE pointer as well as a file descriptor . I don't find any page faults(major) in both the cases.
Why is it so? Do page faults in a program occur only when internally swapping takes place ?
If yes can you suggest a C program which will incur a page fault.
I am working on Ubuntu 12.04, my computer specs: 4GB ram , 500 GB Hardisk
Thanks in advance