I have two operating system related questions. My first one relates to frame allocation, more specifically equal allocation for a specific situation. The situation I have is that there are 200 free frames in memory and two processes which are trying to be paged in - P1 has 50 pages, and P2 which has 350 pages. Now my question is what exactly happens with P1? Does it give P1 100 frames because having two processes and giving them an equal number would make each get 100, or does it only give P1 50 frames and give the rest to P2? I would assume but would be the later option but I don't know for sure.
Asked
Active
Viewed 346 times
0

Craig S. Anderson
- 6,966
- 4
- 33
- 46

Ramirez77
- 107
- 5
-
1The answer to your question is quite operating system dependent. Some operating systems do _demand paging_ where it only brings in program text pages when the are referenced. In that case the answer is that the OS gives both processes 0 pages, then has them fault in what they need. – Craig S. Anderson Apr 23 '15 at 05:41
-
@CraigS.Anderson- Please post that as an answer. It's a bad habit to answer questions in the comment section. Please perform the requisite. – Am_I_Helpful Apr 23 '15 at 06:11
1 Answers
0
The answer to your question is highly operating system specific and even time specific. In ye olde days of limited physical memory it was common for operating systems to swap process in and out of physical memory even when there was paging.
Now it is more common to just rely on paging. P1 may have 50 pages but the OS may only keep 5 of those at a time in memory.
Generally pages are only loaded when they are accessed. There has to be a page fault to load the page. (There are exceptions to that general rule).

user3344003
- 20,574
- 3
- 26
- 62