1 / 13

Memory Management

Memory Management. The performance of the computer system depends mainly of:How much memory is available.How it is optimized while jobs are being processed.. Memory Management Schemes. Single-User Contiguous scheme.Fixed-partitions scheme.Dynamic partition scheme.Re-locatable dynamic partiti

rene
Download Presentation

Memory Management

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


    1. Memory Management OS, lecture3

    2. Memory Management The performance of the computer system depends mainly of: How much memory is available. How it is optimized while jobs are being processed.

    3. Memory Management Schemes Single-User Contiguous scheme. Fixed-partitions scheme. Dynamic partition scheme. Re-locatable dynamic partition scheme.

    4. Single-User Contiguous scheme Each program is loaded in its entirety into memory and allocated as much contiguous space as it needed. Once the program is loaded into memory, it remains there until execution is complete. Only one program can be loaded in memory. Advantages: Simple.

    5. Single-User Contiguous scheme(2) Disadvantages: If the program is larger than the available memory space, it couldn’t be executed. It doesn’t support multiprogramming. Possible solutions: The size of main memory must be increased. The program must be modified to make it smaller.

    6. Single-User Contiguous scheme 1- store the first memory location of program into base register. 2- Set program counter equal to address of first memory location. 3- Load instructions of program. 4- increment program counter by number of bytes in instructions. 5- has the last instruction been reached? if yes, stop loading program. in no, continue with step 6. 6- is program counter greater than memory size? if yes, stop loading. if no, continue with step 7. 7- load instruction in memory. 8- go to step 3.

    7. Fixed Partitions Memory is divided into many unequal size, fixed partitions. Each partition has to be protected. Before loading a job, its size must be matched with the size of the partition to make sure it fits completely. Only one job can be loaded into a partition. The memory manager must keep a table showing each partition size, address, and its current status (free/busy).

    8. Fixed Partitions: Example

    9. Fixed Partitions: algorithm Determine job’s requested memory size. If job-size > size of largest partition then reject the job, go to step1. else, continue with step 3. Set counter ‘C’ to 1. Do while ‘C’ <= number of partitions in memory: if job-size > partition-size(C), then C = C+1. else if partition-status(C) = ‘Free’ then, load job into memory-partition(C) change partition-status(C) to ‘Busy’ go to step 1. else C = C+1 End do No partition available, put job in waiting list. Go to step 1.

    10. Fixed Partitions Advantages: Multiprogramming. Disadvantages: If partitions sizes are too small, big jobs are rejected. If partitions are too big, memory is wasted. Internal fragmentation. Still, entire and contiguous jobs are required.

    11. Dynamic Partitions Jobs are given only as much memory as they request. Still, contiguous blocks are needed. Internal fragmentation problem is solved.

More Related