Deadlock: Difference between revisions
No edit summary |
No edit summary |
||
Line 41: | Line 41: | ||
Segmentation provides more programmer control over the units of transfer in the memory system than paging does. Memory segments are distinct from memory pages because the segments are usually much larger then pages, and can be of a variable size. | Segmentation provides more programmer control over the units of transfer in the memory system than paging does. Memory segments are distinct from memory pages because the segments are usually much larger then pages, and can be of a variable size. | ||
==Paging== | |||
allocation strategy in a paging system to reduce external fragmentation by transferring a fixed-size unit of virtual address space-a page- whenever a virtual address in it is needed to execute the program. Every process’s virtual address space is logically divided into pages, with each page having the same number of location. | allocation strategy in a paging system to reduce external fragmentation by transferring a fixed-size unit of virtual address space-a page- whenever a virtual address in it is needed to execute the program. Every process’s virtual address space is logically divided into pages, with each page having the same number of location. | ||
Revision as of 21:10, 9 November 2007
(currently under construction!)
Swapping
A memory management technique where a process may periodically have its primary memory space deallocated. This forces the swapped-out process to compete for memory before it can once again compete for the processor
Swapping is especially well suited to timesharing systems since such systems often have times when a user logs onto the machine and hence is using some resources, but is inactive for relatively long periods ( and hence not using the CPU). A swapping memory manager accommodates the timesharing scenario by allocating memory to a process while the user is requesting service at a relatively high rate but deallocating memory
Overlays
Significant problem with overlays , when do you load x, y or z, we have to make sure they are there. Developers need to think carefully what they put in these modules. Another problem with swapping is that x, y, and z can’t now talk to each other , they need some sort of cut / paste buffer. Problem is that x, y and z are different sizes and we need to fit the biggest one in the overlay area.
X,Y and Z are all desired to be loaded in the same area of RAM. In traditional overlay schemes this would be an index.
Classic problem of memory management: One problem: fragmentation, difference between size of overlay area and size of the overlays
Instead of having one overlay area what if we had many?
Fragmenatation
- Data fragmentation
Reduces the amount of fragmentation in file systems. Occurs when a piece of data in memory is broken up into many pieces. Two types of fragmentation which exist are internal fragmentation and external fragmentation
- Internal Fragmentation
Space is wasted in return for increased efficiency or simplicity. Ex in many file systems files always start at the beginning of a sector, which simplifies organization and makes it easier to grow files. Any space that is left over between the last byte of the file and the first byte of the next sector is internal fragmentation. Internal fragmentation occurs when the index pages are not being used to their maximum volume
- External Fragmentation
In such a fragmentation, the free space which is available for storage is divided into many small pieces. The storage space is of many different sizes.
- Page
fixed-length block of main memory, that is contiguous in both physical addressing and virtual memory addressing.
Memory Segmentation
technique used to divide memory into smaller units. It is an extension of the ideas suggested by the use of relocation-limit registers for relocating and bound checking blocks of memory. Memory contents are referenced using a two-component virtual address <segmentNumber, offset> . Segment number identifies the particular logical block of memory and offset is a linear offset from the beginning of the segment. Segmentation provides more programmer control over the units of transfer in the memory system than paging does. Memory segments are distinct from memory pages because the segments are usually much larger then pages, and can be of a variable size.
Paging
allocation strategy in a paging system to reduce external fragmentation by transferring a fixed-size unit of virtual address space-a page- whenever a virtual address in it is needed to execute the program. Every process’s virtual address space is logically divided into pages, with each page having the same number of location.
The program translation image is constructed to fit in a set of G continguous memory locations, with virtual addresses ranging between 0 and G-1. When the process executes it is allocated enough primary memory to store the contents of H memory locations where H<G (that is the process has fewer physical memory locations than virtual addresses) reference ( text) In a binary computer the paging system maps the virtual addressees in the absolute module (0-G) into a set of n = 2^g pages, each of size c = 2^h. If G is not an integer multiple of the page size then part of the last page will be lost to internal fragmentation; the paging system will adjust G upward to hold the entire virtual address space.
Physical address space is the portion of the primary memory allocated to the process. The units of allocation are page frames and these are blocks of primary memory which are the same size as the page. The physical address space can be though of as a set of m = 2^j page frames each of size c = 2^h, so the amount of primary memory allocated to the process is H = 2^(h+j)