Sunteți pe pagina 1din 12

THE INSTITUTE OF FINANCE MANAGEMENT

ASSIGNMENT SUBJECT NAME: COURSE: MEMBERS: 1. 2. 3. 4. 5. 6. 7. KALOLO, CHRISTOPHER BIT/10/54062 KYOMO, DOREEN BIT/10/43650 MIKINGI, FARAJI BIT/10/52642 LIBORI, NICOLAUS C. BIT/10/53242 MICHAEL, DEUS BIT/10/54029 CHUWA, STELLA E. BIT/10/43135 CHAKINDO, MICKIDAD BIT/10/52224 OPERATING SYSTEM B Sc. IT 1 B

SOLUTION 1 (a) (i) Multiprogramming is a rudimentary simultaneous for m of parallel processing whereby several programs are run are at the same time on a single processor. It is used so as to allow the computer to perform several instructions at the same time. Multiprogramming makes efficient use of the CPU by overlapping the demands for the CPU and its I/O devices from various users. It attempts to increase CPU utilization by always having something for the CPU to execute. (ii) Internal fragmentation is a situation in which small blocks of unusable memory are created within a partition. Internal fragmentation occurs when storage is allocated without the intention to use it. This space is wasted inside allocated memory blocks because of restriction on the allowed sizes of allocated blocks. Allocated memory may be slightly larger than requested memory hence internal fragmentation. Iii) External fragmentation is a situation in which small blocks of unusable memory are created between partitions. External fragmentation happens when a dynamic memory allocation algorithm allocates memory and a small piece is left over than cannot be effectively used. iv)Compaction is a mechanism of shuffling the memory blocks such that all free portions of the memory can be aligned together in a single large block. Done by OS to overcome the problem of fragmentation. Compaction is done frequently at run time only when reallocation is dynamic. If reallocation is static and done at load time then compaction is impossible. b) 1. SINGLE-USER CONTIGOUS SYSTEM.

ADVANTAGES i) ii) Gives opportunity to each user to access to all available main memory for each job. Each jobs are processed sequentially.

DISADVANTAGES i) ii) iii) It doesnt support multiprogramming and networking, It can handle only one job at a time Used only in research institutions but proved unacceptable for the business community.

2. FIXED PARTIONS ADVANTAGES i) ii) It supports the multiprogramming, Protection of the jobs memory space.

DISADVANTAGES

i) ii) iii)

Arbitrary partition sizes lead to undersized results Too small a partition size results in large jobs having longer turnaround time. Too large a partition size results in memory waste or internal fragmentation.

3. DYNAMIC PARTITIONS. ADVANTAGES i) ii) Memory isnt wanted within the partition. Is the improvement over the fixed partitions.

DISADVANTAGES i) Fully utilizes memory only when the first jobs are loaded.
Request dynamic elative addressing.

4. RE-ALLOCATABLE DYNAMIC PARTIONS ADVANTAGES i) It help to accommodate some or all of the jobs waiting to get in by the memory manager relocates programs together all of the empty blocks and compact them to make one block of memory which is large.

DISADVANTAGES i) ii) Time consuming is very high, Due to compaction every program in the memory must be reloadable so they are contiguous, Operating system must distinguish between addresses and data values which consumes a time

c) i) Best fit algorithm BLOCK ADRESS 1024k 56320k 64k 512k 20480k 40960k BLOCK SIZE 10k 20k 20k 35k 45k 70k ACCESS J1 J2 J3 JOB SIZE 10k 20k 5k STATUS Busy Busy Busy Free Free Free FRAGMENTATION Null Null 15k 35k 45k 70k

Total used memory = 35k ii) First fit algorithm BLOCK BLOCK SIZE ADRESS 1024k 10k 512k 35k 40960k 70k 56320k 20k 20480k 45k 64k 20k Total used memory = 35k iii) Already attempted ACCESS J1 J2 J3 JOB SIZE 10k 20k 5k

total unused = 165k

STATUS Busy Busy Busy Free Free Free

FRAGMENTATION

Null 15k 65k 20k 45k 20k total unused = 165k

d) i) First fit algorithm BLOCK BLOCK SIZE ADRESS A 100k B 700k C 750k D 1500k E 300k F 350k J3 & J4 must wait ACCESS J2 J5 J1 JOB SIZE 25k 325K 1000k STATUS Busy Busy Free Busy Free Free FRAGMENTATION 75k 375k 750k 500k 300k 350k

ii) Best fit algorithm BLOCK BLOCK SIZE ADRESS A 100k E 300k F 350k B 700k C 750k D 1500k J3 & J4 must wait ACCESS J2 J5 JOB SIZE 25k 325k STATUS Busy Free Busy Free Free Busy FRAGMENTATION 75k 300k 25k 700k 750k 500k

J1

1000k

iii) Worst fit algorithm BLOCK BLOCK SIZE ADRESS A 100k E 300k F 350k B 700k C 750k D 1500k J3 & J4 must wait SOLUTION 2 a) (i) First-fit: search the list of available memory and allocate the first block that is big enough. (ii) Best-fit: search the entire list of available memory and allocate the smallest block that is big enough. (iii) Worst-fit: search the entire list of available memory and allocate the largest block. (The justification for this scheme is that the leftover block produced would be larger and potentially more useful than that produced by the best-fit approach.) (i) Memory block address A B C D E First fit BEFORE ALLOCATION Memory Access block size 100k 500k 200k 300k 600k AFTER ALOCATION Memory Access block size 100k 500k 200k 300k 600k J4 must wait, ACCESS JOB SIZE STATUS Free Free Free Busy Busy Busy FRAGMENTATION 100k 300k 350k 375k 725k 500k

J5 J2 J1

325k 25k 1000k

Job size

Status

Fragments

Free Free Free Free Free

Memory block address A C D B E

Job size

Status

Fragments

J1 J3 J2

212K 112K 417K

Free Busy 288k Busy 88k FREE 300K busy 183k Un used space = 859k

(ii)

Best fit

BEFORE ALOCATION

Memory block address A C D B E

Memory block size 100k 200k 300k 500k 600k

Access

Job size

Status

Fragments

FREE FREE FREE FREE FREE

AFTER ALOCATION Memory block address A C D B E Memory block size Access Job size Status Fragments

100k 200k J3 300k J2 500k J1 600k J4 Un used space = 533K Worst fit

112K 212K 417K 426K

Free Busy Busy Busy busy

100K 88k 88k 83k 174k

(iii)

BEFORE ALOCATION Memory block address A C D B E Memory block size 100k 200k 300k 500k 600k AFTER ALOCATION Access Job size Access Job size Status Fragments

FREE FREE FREE FREE FREE

Memory block address A C D

Memory block size 100k 200k 300k

Status

Fragments

J3

112K

Free FREE Busy

100K 200K 188k

B E

500k 600k

J2 J1

417K Busy 212K busy Un used space = 959K

83k 388k

Hence, The best Algorithm is the Best - fit. b)

1.FIRST-FIT ALGORITHM Advantage -Faster in making allocation Disadvantage -Wastage of memory is large 2.BEST-FIT ALGORITHM Advantage -It save unnecessary usage of memory. Disadvantage -It works slowly. 3. WORST-FIT ALGORITHM Advantage -It make the best use of memory space Disadvantage -It result into large memory space wastage
c) (i) Memory block address A B C D E First fit BEFORE ALLOCATION Memory Access block size 100k 500k 200k 300k 600k AFTER ALOCATION Memory Access block size 100k

Job size

Status

Fragments

Free Free Free Free Free

Memory block address A

Job size

Status

Fragments

Free

C D B E (ii)

500k 200k 300k 600k J4 must wait, Best fit

J1 J3 J2

212K 112K 417K

Busy 288k Busy 88k FREE 300K busy 183k Un used space = 859k

BEFORE ALOCATION

Memory block address A C D B E

Memory block size 100k 200k 300k 500k 600k

Access

Job size

Status

Fragments

FREE FREE FREE FREE FREE

AFTER ALOCATION Memory block address A C D B E Memory block size Access Job size Status Fragments

100k 200k J3 300k J2 500k J1 600k J4 Un used space = 533K Worst fit

112K 212K 417K 426K

Free Busy Busy Busy busy

100K 88k 88k 83k 174k

(iii)

BEFORE ALOCATION Memory block address A C D B E Memory block size 100k 200k 300k 500k 600k AFTER ALOCATION Access Job size Status Fragments

FREE FREE FREE FREE FREE

Memory block address A C D B E

Memory block size 100k 200k 300k 500k 600k

Access

Job size

Status

Fragments

J3 J2 J1

112K 417K 212K Un used space = 959K

Free FREE Busy Busy busy

100K 200K 188k 83k 388k

d)

i) FIRST-FIT ALLOCATION ALGORITHM Allocation Requests Free chunk Available (Bytes) 10 15 10 10 20 40 10 Status Busy Fragmentations null

Busy 5bytes Busy 30bytes Free 10bytes Total unused space =45bytes The allocation request for 35 must wait. Therefore all requests wont succeed. . ii).BEST-FIT ALLOCATION ALGORITHM. Allocation Requests Free chunk Available(Bytes) 10 10 15 10 10 20 35 40 Total Hence, all request will succeed. iii) The better is the best fit algorithm

Status Fragnentation Busy null Busy null Busy 5bytes Busy 5bytes unused space =10bytes

QUESTION 3

a. Case 1: eallocation is done by combining two adjacent free blocks when the memory to be deallocated is adjacent to another free memory block

b. block is deallocated between two free block when size of free partition must be combined(last o f the three) to provide the status of null

c) block to be deallocated is isolated from other free block when the system determine released emory block status and search table for a null

S-ar putea să vă placă și