Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

The virtual address space of a process is 1 GB large. Assume that th

Rating
-
Sold
-
Pages
1
Grade
A
Uploaded on
27-06-2023
Written in
2022/2023

The virtual address space of a process is 1 GB large. Assume that the size of a page size is 4KB. What is the maximum size of a page table in memory if each page table entry requires 4 bytes? Assume a 4KB large page and frame size. Consider the following page table associated with a process: Page# Frame# Valid/Invalid 0 1 v 1   4   v 2   3 v 3   5   i 4   10   v The table shows the page and frame number as well as the valid and invalid bit per page table entry. What is the physical addresses for the virtual address 0x500? Enter information in hexadecimal (must start with 0x). Enter the string "PF" if a virtual address resolution triggers a page fault. Solution We need to analyze memory and time requirements of paging schemes in order to make a decision. Average process size is considered in the calculations below. 1 Level Paging Since we have 2^23 pages in each virtual address space, and we use 4 bytes per page table entry, the size of the page table will be 2^23 * 2^2 = 2^25. This is 1/256 of the process' own memory space, so it is quite costly. (32 MB) 2 Level Paging The address would be divided up as 12 | 11 | 13 since we want page table pages to fit into one page and we also want to divide the bits roughly equally. Since the process' size is 8GB = 2^33 B, I assume what this means is that the total size of all the distinct pages that the process accesses is 2^33 B. Hence, this process accesses 2^33 / 2^13 = 2^20 pages. The bottom level of the page table then holds 2^20 references. We know the size of each bottom level chunk of the page table is 2^11 entries. So we need 2^20 / 2^11 = 2^9 of those bottom level chunks. The total size of the page table is then: 3 Level Paging For 3 level paging we can divide up the address as follows: 8 | 8 | 7 | 13Again using the same reasoning as above we need 2^20/2^7 = 2^13 level 3 page table chunks. Each level 2 page table chunk references 2^8 level 3 page table chunks. So we need 2^13/2^8 = 2^5 level-2 tables. And, of course, one level-1 table. The total size of the page table is then: As easily seen, 2-level and 3-level paging require much less space then level 1 paging scheme. And since our address space is not large enough, 3-level paging does not perform any better than 2 level paging. Due to the cost of memory accesses, choosing a 2 level paging scheme for this process is much more logical.//size of the outer page table   //total size of the inner pages1 * 2^12 * 4+    2^9 * 2^11 * 4=    2^20 * ( 2^-6 + 4) ~4MB

Show more Read less
Institution
Course

Content preview

9.4 (Opportunities for defects) Every additional line of code is an opportunity for a defeat.
Discuss the ways in which inheritance promotes defect reduction.
9.7 (protected vs private) Some programmers prefer not to use protected access, because they
believe it breaks the encapsulation of the superclass. Discuss the relative merits of using
protected access vs using private access in superclass.
9.11 (super) Explain two usages of the super keyword, and state some of the advantages of each
type of usage.
9.12 (Using super) A method decode() is declared in a parent class, and also the child. How can
you access the decode() of the parent from within the child?
2-3 sentences for each


Solution


9.7) superclass\' protected members are accessible by an indirect subclass.most compilers will
complain that the extened class doesn\'t exist.(import object.classname)
9.11)most compilers will complain that the extened class doesn\'t exist.super is used to refer
immediate parent class instance variable.super() is used to invoke immediate parent class
constructor.super is used to invoke immediate parent class method.
9.4)able to reuse code for different classes by putting it in a common superclass
9.12)extending from virtual or abstract classes can use super.You can only use super in methods
that are designated with the override keyword.

Written for

Course

Document information

Uploaded on
June 27, 2023
Number of pages
1
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.38
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
meejuhaszjasmynspe52866

Get to know the seller

Seller avatar
meejuhaszjasmynspe52866 Self
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
338
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions