page-fault

Which (OS X) dtrace probe fires when a page is faulted in from disk?

I'm writing up a document about page faulting and am trying to get some concrete numbers to work with, so I wrote up a simple program that reads 12*1024*1024 bytes of data. Easy: int main() { FILE*in = fopen("data.bin", "rb"); int i; int total=0; for(i=0; i<1024*1024*12; i++) total += fgetc(in); printf("%d\n", total); } ...

Page fault count within two arrays?

Homework: Consider the two-dimensional array A: int A[][] = new int[200][200]; where A[0][0] is at location 500 in a paged memory system with pages of size 500 (a little unrealistic -- not 512). A small process that manipulates the matrix resides in page 0 (locations 0 to 499). Thus, every instruction fetch will be from an ins...

How does OS locate contents on disk that have not been loaded into memory when page fault exception is raised?

When a page fault exception is raised because the content CPU is trying to access have not been loaded in to memory, how does the OS locate the missing content on the secondary storage (e.g. hard disk)? Thanks for your explanation in advance. -ivan ...

40 million page faults. How to fix this?

I have an application that loads 170 files (let’s say they are text files) from disk in individual objects and kept in memory all the time. The memory is allocated once when I load those files from disk. So, there is no memory fragmentation involved. I also use FastMM to make sure my applications never leaks memory. The application comp...