Question 1:
Q: Explain the differences between a page and a segment.
A: Paged memory allocation is based on the concept of dividing each incoming job into pages of equal size. A page is a fixed-size section of a user’s job that corresponds in size to page frames in main memory. With segmented memory allocation, each job is divided into several segments of different sizes, one for each module that contains pieces that perform related functions. A segment is a variable-size section of a user’s job that contains a logical grouping of code.
Question 2:
Q: List the advantages and disadvantages for each of the memory management schemes presented.
1. The primary advantage of paged memory allocation is that it stores programs in noncontiguous locations, allowing main memory to be used more efficiently because an empty page frame can be used by any page of any job. This also means that there is no internal or external fragmentation. The disadvantage is that the Memory Manager now needs a mechanism to keep track of each job’s pages because they can be located anywhere in memory.
2. Demand Paging introduced the concept of loading only part of the program into memory for processing. It takes advantage of the fact that programs are written sequentially so that while one section is processed all of the other sections (modules) are idle. Most importantly, demand paging made virtual memory possible. The disadvantage with demand paging is a phenomenon called thrashing. This is occurs when an excessive amount of page swapping between main memory and secondary memory takes place, causing the operation to become inefficient.
3. Segmented Memory Allocation is based on the concept on the common practices by programmers in how they structure their programs- logical grouping of code. Segmented memory allocation reduces page faults that resulted from having a segment’s loop split over two or more pages. The disadvantage is the return of external fragmentation; therefore recompaction of available memory is necessary.
4. Segmented/Demand Paged Memory Allocation is a combination of segmentation and demand paging. The advantage is that it offers the logical benefits of segmentation, as well as the physical benefits of paging. The major disadvantages of this scheme are the overhead required for the extra tables and the time required to reference the segment table and the page table.
Question 3:
Q: What purpose does the modified bit serve in a demand paging system?
A: The modified bit determines in the page has been modified. It is used to same time when pages are removed from main memory and returned to secondary storage. If the contents of the page haven’t been modified, then the page doesn’t have to be rewritten to secondary storage.
Question 4:
4A. What is the cause of thrashing?
Thrashing occurs when there is an excessive amount of page swapping between main memory and secondary storage, causing the operation to become inefficient. Typically it is when a page is removed from memory, and then called back quickly.
4B. How does the operating system detect thrashing?
The operating system can detect thrashing by evaluating the level of CPU utilization as compared to the level of multiprogramming.
4C. Once thrashing is detected, what can the OS do to eliminate it?
Thrashing can be eliminated by reducing the level of multiprogramming.
Question 5:
What purpose does the referenced bit serve in a demand paging system?
The reference bit indicates any recent activity, it is used to determine which pages show the most processing activity, and which are relatively inactive. This information is used by several page-swapping policy schemes to determine which pages should remain in memory and which should be swapped out when the system needs to make room for other pages being requested.
Learn how to create volumes, set up global mirror replication and manage a virtual infrastructure using IBM Storwize and VMware technologies... by Christa Selby
17.2.09
16.2.09
Memory Management
Question 1.
A. Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs simultaneously. Multiprocessing makes it possible for several programs to be active at the same time while still running through a single processor. The key factor is that multiprogramming maximizes the CPU to run programs more efficiently.
B. Internal fragmentation is the space that is wasted inside of allocated memory blocks due to restrictions on the allowed sizes of allocated blocks, sometimes it is never even intended to be used. This is often accepted in return for increased efficiency.
C. External fragmentation is when free storage becomes divided into small sections over time. This occurs when an application allocates and deallocates regions of storage of various sizes, and the allocation algorithm responds by leaving the allocated and deallocated sections scattered. External fragmentation can also occur in file systems as files of various sizes are created, altered, and deleted. This is worsened if the file has been divided into smaller files and deleted, leaving miniscule areas of unused space.
D. Memory compaction is a method used to relocate information blocks in main memory in order to maximize the available free space in the memory.
E. Relocation can sometimes occur automatically when a program is being loaded. The frequency of memory relocation often depends on the operating systems designer who, based on the job mix and other factors, tries to optimize both processing time and memory use while keeping overhead as low as possible.
Question 2:
Describe the major disadvantages for each of the four memory allocation schemes presented in this chapter.
1. Single-user Systems: One of the first problems with this type of memory allocation scheme is that it doesn’t support multiprogramming or networking; it can only handle one job at a time. The other major disadvantage was when the first single-user configurations were made available commercially in the late 1940’s and early 1950’s they were not cost effective for business use. Averaging nearly $200,000 per piece of equipment for only one operator was not proficient.
2. Fixed Partitions: The size of a partition could only be designated when the machine was powered on, so in order to reconfigure a partition size, the machine had to be shut down, reconfigured, and powered back on. Fixed partitions often resulted in wasted memory. If the partition size was too small, larger jobs were rejected- which meant a longer turnaround time, on the other hand, if a partition size were too big, then memory sat idle and was wasted. Wasted space and partial usage of fixed partitions resulted in the phenomenon of internal fragmentation.
3. Dynamic Partitions: This memory scheme operates on the first come, first serve basis; meaning that as newer jobs enter the system that are not the same size as those that just vacated memory, they are fit into available spaces on a priority basis. When the subsequent allocation of memory creates fragments of free memory between blocks of allocated memory, external fragmentation arises.
4. Re-locatable Dynamic Partitions: This is a memory allocation scheme in which the system relocates programs in memory to gather together all of the empty blocks and compact them to make one block of memory that is large enough to accommodate some or all of the jobs waiting for memory. Problems arise when deciding on the best possible time of the compaction.
Question 3:
Describe the major advantages for each of the memory allocation schemes presented in the chapter.
1. Single-user Systems: The code to perform the functions is straightforward, and the logic is simple. It required only two hardware items, a register and an accumulator.
2. Fixed Partitions: This partition scheme was more flexible than the single-user scheme because it allowed several programs to be in memory at the same time. It worked best if all the jobs on the system were of the same size or if the sizes were known ahead of time.
3. Dynamic Partitions: Available memory was kept in contiguous blocks, and jobs were only given as much memory as they requested when being loaded into memory.
4. Re-locatable Dynamic Partitions: Memory manager relocates programs to gather together all of the empty blocks and compact them to make one block of memory large enough to accommodate some or all of the jobs waiting to get in.
Question 4:
A. Job 1 would enter block 2, Job 2 would enter block 1, and Job 3 would enter block 3.
B. Job 1 would wait, Job 2 would enter block 1, job 3 would then enter block 2, and job 1 would enter block 2 once Job 1 completed.
A. Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs simultaneously. Multiprocessing makes it possible for several programs to be active at the same time while still running through a single processor. The key factor is that multiprogramming maximizes the CPU to run programs more efficiently.
B. Internal fragmentation is the space that is wasted inside of allocated memory blocks due to restrictions on the allowed sizes of allocated blocks, sometimes it is never even intended to be used. This is often accepted in return for increased efficiency.
C. External fragmentation is when free storage becomes divided into small sections over time. This occurs when an application allocates and deallocates regions of storage of various sizes, and the allocation algorithm responds by leaving the allocated and deallocated sections scattered. External fragmentation can also occur in file systems as files of various sizes are created, altered, and deleted. This is worsened if the file has been divided into smaller files and deleted, leaving miniscule areas of unused space.
D. Memory compaction is a method used to relocate information blocks in main memory in order to maximize the available free space in the memory.
E. Relocation can sometimes occur automatically when a program is being loaded. The frequency of memory relocation often depends on the operating systems designer who, based on the job mix and other factors, tries to optimize both processing time and memory use while keeping overhead as low as possible.
Question 2:
Describe the major disadvantages for each of the four memory allocation schemes presented in this chapter.
1. Single-user Systems: One of the first problems with this type of memory allocation scheme is that it doesn’t support multiprogramming or networking; it can only handle one job at a time. The other major disadvantage was when the first single-user configurations were made available commercially in the late 1940’s and early 1950’s they were not cost effective for business use. Averaging nearly $200,000 per piece of equipment for only one operator was not proficient.
2. Fixed Partitions: The size of a partition could only be designated when the machine was powered on, so in order to reconfigure a partition size, the machine had to be shut down, reconfigured, and powered back on. Fixed partitions often resulted in wasted memory. If the partition size was too small, larger jobs were rejected- which meant a longer turnaround time, on the other hand, if a partition size were too big, then memory sat idle and was wasted. Wasted space and partial usage of fixed partitions resulted in the phenomenon of internal fragmentation.
3. Dynamic Partitions: This memory scheme operates on the first come, first serve basis; meaning that as newer jobs enter the system that are not the same size as those that just vacated memory, they are fit into available spaces on a priority basis. When the subsequent allocation of memory creates fragments of free memory between blocks of allocated memory, external fragmentation arises.
4. Re-locatable Dynamic Partitions: This is a memory allocation scheme in which the system relocates programs in memory to gather together all of the empty blocks and compact them to make one block of memory that is large enough to accommodate some or all of the jobs waiting for memory. Problems arise when deciding on the best possible time of the compaction.
Question 3:
Describe the major advantages for each of the memory allocation schemes presented in the chapter.
1. Single-user Systems: The code to perform the functions is straightforward, and the logic is simple. It required only two hardware items, a register and an accumulator.
2. Fixed Partitions: This partition scheme was more flexible than the single-user scheme because it allowed several programs to be in memory at the same time. It worked best if all the jobs on the system were of the same size or if the sizes were known ahead of time.
3. Dynamic Partitions: Available memory was kept in contiguous blocks, and jobs were only given as much memory as they requested when being loaded into memory.
4. Re-locatable Dynamic Partitions: Memory manager relocates programs to gather together all of the empty blocks and compact them to make one block of memory large enough to accommodate some or all of the jobs waiting to get in.
Question 4:
A. Job 1 would enter block 2, Job 2 would enter block 1, and Job 3 would enter block 3.
B. Job 1 would wait, Job 2 would enter block 1, job 3 would then enter block 2, and job 1 would enter block 2 once Job 1 completed.
Subscribe to:
Posts (Atom)