home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume44 / toy_os / part04 / virt_mem_comp.txt < prev   
Text File  |  1994-09-05  |  2KB  |  66 lines

  1.         Comparison of page replacement startegies
  2.  
  3.  
  4. Test example: 
  5. Set of 3 jobs running concurrently in VM UNT
  6. Drum file with program images: prog4/four.123.dat
  7.  
  8.  
  9. SWAP OUT STRATEGY
  10. allocate page until physical memory is exhausted, then find a victim
  11. and swap it out.
  12.  
  13.  
  14.     PID NF   PID  NF    PID NF    PID  NF   PID NF    Total
  15. Job #1  4   0     9   2     10  1      1   3          6
  16.  
  17. Job #2  5   2     7   0     12  2     11   1     2  2      7
  18.  
  19. Job #3  6  43     8  30      3  2             75
  20.                         ---------------
  21.                              88
  22. Note,
  23.     PID    - process ID of a process in the job
  24.     NF    - the total number of the page faults the process
  25.           has incurred by the time it finishes
  26.  
  27.  
  28. LOCAL LRU STRATEGY
  29. The working set quota is set to 14 and reinforced. Any process that
  30. fills its working set up to the quota and still needs more pages,
  31. should first unreference (and swap out) the least recently used
  32. page. The current context of the process keeps a count of the time
  33. (in runs of the process on CPU) a page has last been used. The present
  34. strategy is somewhat similar to that implemented in VAX/VMS.
  35.  
  36.  
  37.     PID NF   PID  NF    PID NF    PID  NF   PID NF    Total
  38. Job #1  4   0     9   2     10  1      1   3          6
  39.  
  40. Job #2  5   2     7   0     12  2     11   1     2  1      6
  41.  
  42. Job #3  6  47     8  32      3  1             80
  43.                         ---------------
  44.                              92
  45.  
  46. CONCLUSION
  47.  
  48. The grand total number of page faults is slightly higher than with the
  49. simple "rob-first-appropriate" page replacement strategy. Yet one has
  50. to keep in mind that processes #6 and #8 are far from being "local",
  51. they were designed to systematically access all their address space.
  52. Typically a process spends most of the time fooling around a limited
  53. segment of data and code. Anyway, it should be stressed that the
  54. present system run has completed without any process swapping. In
  55. reality, process swapping is actually quite expensive and involves a
  56. lot of flurry. The process performance suffers from that as well (if
  57. the process is interactive, the user notices that right away). Note
  58. that with the local LRU strategy, only a memory-greedy process
  59. incurres some extra page faults. But it does not affect other process.
  60. In fact, the number of page faults of other processes is as small as
  61. possible. It means, the process with large memory requirements would
  62. suffer a little from its greed, but it would not punish "moderate"
  63. processes.  So, the bottom line is, the overall system performance
  64. with the local LRU strategy seems to be better.
  65.  
  66.