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

in virtual memory data and it is not available in the RAM. Reading from a file such as I / O functions such as 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

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -