Question

In: Computer Science

a) Explain how performance can be controlled in virtual memory. (b) How does the OS implement...

a) Explain how performance can be controlled in virtual memory.

(b) How does the OS implement dynamic allocation of frames?

c) Explain the main difficulty in using and/or managing virtual memory.

Solutions

Expert Solution

(a) Performance can be controlled in virtual memory by the following ways :

When large amounts of virtual memory are required, then we need to make the minimum and maximum sizes of virtual memory file identical. It also forces the operating system for allocating the entire paging file while starting of the machine. It keeps the paging file from growing while the program is running which could help in increasing the performance. Many of the video applications may recommend the same technique for avoiding pauses while reading or while writing the the information of video in hard disk and tape.

One more factor of the performance of virtual memory is location of a pagefile. If the system is having multiple physical hard drives, then the you would be able to spread the work with them for making the smaller pagefile on each of the drive. This modification would help in speed up the system which makes heavy use of the virtual memory.

(b) The process must allocate the frames for the current locality. If more of the frames gets allocated to then there is some little improvement. If less frames are been allocated then there may be very high page fault rate. The dynamic paging would be using the locality model ie., and the set of pages used for the particular phase of computation. The page frames are dynamically allocated to the among the process that is the page frames of a process would vary. As the process working set grows and it also shrinks, the it will be able to allocate more or less page frames.

It is implemented by using the Frame-Allocation Algorithms which will be deciding the number of frames which needs to be allocated for each process.

The ultimate Goal is for allocating enough frames to keep all pages used in the current locality of references without allocating too many page frames.

Implementation strategies:

EQUAL ALLOCATION: each number of the frames would be evenly distributed through processes here . Not all that useful as not every process would need an equivalent number of frames; some processes would need some additional frames, while some processes may require fewer frames.
For example, provided the number of frames: 6
No. of available processes: 3
As a result, each phase will have 2 frames

WEIGHTED ALLOCATION: Based on the size of the operation, the number of the frames will be assigned accordingly. More number of frames will be given the larger size of the process. It is mostly used in contrast to other algorithms.
For example: available processes in size P1: 20 Pages, P2: 30 Pages, P3: 50 Pages
Frames available: 10
Requirements: P1=20/100 * 10=2.
P2=30/100 * 10=3
P3=50/100 * 10=5

PRIORITY ALLOCATION: Processes with the higher priority no. are more framed. If a higher-priority process requires more structures, it will override a lower-priority process aggressivel. Suppose the process P1 is having a higher priority than the process P2 and it requires more frame than P1 pulls out P2 and uses the frame.

The page replacement algorithms :

The Page Replacement Algorithm lets us determine which page should be replaced to get the lowest page fault rate, and this decision has a major impact on the performance of it.

Types:

LOCAL PAGE – REPLACEMENT: The local page replacement technique would work as a static allocation whenever its need to replace a page from the main memory, this might only replace the page from the frames assigned to that specific process and without disrupting any other pages of other processes.

GLOBAL PAGE-REPLACEMENT: This replacement method is different from the local page replacement strategy, while replacing every page that is required to be consider something to replace, it might consider replacing all the available frames.

(c) Problems in virtual memory
It would make the computer to run slower and because the processor has to wait while the data is swapped between the hard disk and the RAM. Here the secondary storage devices is having slower access time than the RAM, the processing performance of the computer can be severely impaired.
The applications do run very slowly when the system uses the virtual memory. It takes more time for switching between the applications. It also offers less hard drive space for the uses and reduces the system stability.

Difficulties or disadvantages of using the virtual memory are:

  • Applications may run slower if the device uses the virtual memory.
  • It might be taking more time to switch between applications.
  • It would give or provide less room on the hard drive for the use.
  • It will decrease the reliability of the system.
  • It would allow larger applications to run on systems that do not have enough physical RAM to run on their own.
  • It will not deliver the same efficiency as the RAM.
  • This will adversely affects the overall efficiency of the system

Related Solutions

What is the difference between internal and external fragmentation? How does the use of virtual memory...
What is the difference between internal and external fragmentation? How does the use of virtual memory improve system utilization?
Design and implement a Demand Paging virtual memory simulator! It must be a text based application...
Design and implement a Demand Paging virtual memory simulator! It must be a text based application (NOT a GUI based one). You can use the C/C++ or Java programming language. The following algorithms must be implemented: FIFO, OPT, LRU and LFU. The application must simulate the execution of each of these algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1, N<8), assuming that the single process that is running has a virtual memory of...
Design and implement a Demand Paging virtual memory simulator! It must be a text based application...
Design and implement a Demand Paging virtual memory simulator! It must be a text based application (NOT a GUI based one). You can use the C/C++ or Java programming language. The following algorithms must be implemented: FIFO, OPT, LRU and LFU. The application must simulate the execution of each of these algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1, N<8), assuming that the single process that is running has a virtual memory of...
Design and implement a Demand Paging virtual memory simulator! It must be a text based application...
Design and implement a Demand Paging virtual memory simulator! It must be a text based application (NOT a GUI based one). You can use the C/C++ or Java programming language. The following algorithms must be implemented: FIFO, OPT, LRU and LFU. The application must simulate the execution of each of these algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1, N<8), assuming that the single process that is running has a virtual memory of...
OS(Operating Systems) [3] (a) Define DMA (Direct Memory Access).       (b) An input device can transmit 100...
OS(Operating Systems) [3] (a) Define DMA (Direct Memory Access).       (b) An input device can transmit 100 characters every 4 mils 10 , if the CPU needs 2 mics to service the             Interrupt. How much time is left for asynchronous I/O. What if it can transmit 1000 characters             every 4 mils and the CPU also needs 2 mics for the service routine.             What do you think? Explain your answer in details. [4]  (a) What is the interrupt types? Give examples.                 (b)...
1.how can i improve my memory? 2. how is memory measured? 3. how does the brain...
1.how can i improve my memory? 2. how is memory measured? 3. how does the brain form and store memorise?
How does pollens and cold temperature contribute to the pathophysiology os asthma? Briefly explain.
How does pollens and cold temperature contribute to the pathophysiology os asthma? Briefly explain.
How does page fault in OS be handled/resolved?
How does page fault in OS be handled/resolved?
.What is the role of interrupt vector table during interrupt processing? b. How does OS make...
.What is the role of interrupt vector table during interrupt processing? b. How does OS make sure that a user process cannot access I/O devices or any other process’ memory areas? c. How is data parallelism different from task parallelism? Which one of these approaches would you use if you had to compute the average of an array of million numbers? Why? d. What kind of events can cause a process to leave CPU? e. What is the main different...
What is false memory and how does it affect our memory?
What is false memory and how does it affect our memory?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT