Segmentation




This method uses variable sized memory blocks. It is useful because it is very common for size of objects in a program to change dynamically. If single adderss space is used, as in paging, after memory has been allocated it cannot change size resulting in wasted memory or not enough memory. To fix this, computer system would set up many independent address spaces. Each of these address spaces is called Segment. A program is a collection of segments. A segment is a logical unit such as: main program, procedure, function, method, object, local variables, global variables, common block, stack, symbol table, arrays.

Solution differs from pure segmentation in that the segment-table entry contains not the base address of the segment, but rather the base address of a page table for this segment. May be unequal, dynamic size Simplifies handling of growing data structures Allows programs to be altered and recompiled independently Lends itself to sharing data among processes Lends itself to protection

Corresponding segment in main memory Each entry contains the length of the segment A bit is needed to determine if segment is already in main memory Another bit is needed to determine if the segment has been modified since it was loaded in main memory



Advantages and Disadvantages


Home