(This is the older material - click here - for current specification content)

9. Segmentation and Paging

Similarities

Both techniques involve splitting up primary memory into smaller sections.

Both techniques try to make maximum use of RAM.

Segmentation is involved with loading programs into memory. This does not imply that all of the program needs to be loaded at once. It is possible to load only part of the program into primary memory and this part then calls up whatever extra code is required at that point in time. For example, Dynamic Link Libraries can reside on the hard disk until called up into main memory by an executing program.

On the other hand, paging is trying to optimise the use of RAM by dumping unused pages onto the hard disk as virtual memory. In both cases only part of the code needs to be running in RAM.

Both techniques need to make use of indexing in order to access seldom used code.


Pages do not need to be contiguous (i.e. next to each other), in fact this would be a very unusual case i.e. the starting address of page 905 will not necessarily be right next to the starting address of page 906. They could be in an entirely different part of memory. Similarly, program segments can be broken up into non-contiguous memory addresses. It is the job of the memory manager to make it appear to the operating system as if they were contiguous.

 

Differences

Segments may be of variable size, pages are fixed size

Pages are smaller than segments

Computer performance is not affected by having non-contiguous Pages. Whereas segments would prefer to be in one piece within memory for performance reasons. If the segment is not in one piece, then the memory manager has to work harder to manage the application. This fragmentation of segments does affect performance.

 

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: Segmentation and Paging

 

 

 

 

 

 

 

Copyright © www.teach-ict.com