I need help with this question, thanks! 2. Determine for the following code how
ID: 3902423 • Letter: I
Question
I need help with this question, thanks!
2. Determine for the following code how many pages are transferred between disk an memory, assuming each page,has 5000 words, the active memory set size is 2000 (i. e., a any time no more than 2000 pages may be in main memory), and the replacement strategy is LRU (the Least Recently Used page is always replaced); also assume that all two- dimensional arrays are of size (1:10000, 1:10000), with each array element occupying one word, N-10000 for I 1 to 10000 do for J :-1 to 10000 do provided the arrays are mapped into the main memory space (a) in row-major order, (b) in column-major order.Explanation / Answer
For row major order, each row will be stored in adjacent manner. Since, the program is accessing the arrays in row major order, the number of page replacements will be as follows:
For each row, it will take 2 pages. and for the total two dimensional array, 20,000 pages will take. Since there are three arrays, it will take a total of 60,000 page accesses.
For column major order, each column will be stored adjucetly and since the program is accessing the arrays in row major order, the number of page replacements will be as follows:
Each array element access will be from different pages and so for the whole array, there will be 10,000*10,000 page replacements and for the three arrays, the total page raplacements will be 3*10,000*10,000