c - page faults while reading a large file -
I'm working on a system with 4 GB RAM. I started a large file of 4 GB and started it with zero
I started reading the big file integer by integer
I think the number of page defects (major) Is zero, how big is the file.
I did not find any page fault in both the files as both the file pointer as well as the file descriptor.
Why is that so? Does the page fault in a program happen only when I swap internally?
If yes, then you can suggest a program that would be a mistake of a page.
I am working on Ubuntu 12.04, my computer specs: 4 GB RAM, 500 GB hardcuck
thanks in advance
read () or fscanf () does not; You are requesting file contents directly from the disk, not through virtual memory access If you map the file to virtual memory using mmap () And try to access that memory, you will see errors in the file because the contents of the file are loaded automatically.
Comments
Post a Comment