Friday, December 18, 2009

Exercise

1. Given the following information:

      Job List             

            Job Number               Memory Requested

                     J1                                740k
                     J2                               500k
                     J3                                 700k

Memory List

  Memory Block                 Size

        Block 1                        650k

        Block 2                       850k

        Block 3                       700k

a. Use the best-fit algorithm to allocate the memory blocks to the three arriving jobs.

1.a

Memory Block

Memory Block   Size

Job Number

Job Size

Status

Internal Fragmentation

Block 1

650k

J2

500k

Busy

150k

Block 2

 

850k

 

J1

 

740k

 

Busy

 

110k

 

Block 3

700k

J3

700k

Busy

 

0k

Total Available

2200k

Total Used

1940k

 

260k












b. Use the first-fit algorithm to allocate the memory blocks to the three arriving jobs.

1.b

Memory Block

Memory Block   Size

Job Number

Job Size

Status

Internal Fragmentation

Block 1

650k

J2

500k

Busy

150k

Block 2

 

850k

 

J1

 

740k

 

Busy

 

110k

 

Block 3

700k

J3

700k

Busy

 

0k

Total Available

2200k

Total Used

1940k

 

260k

 

 










2. Given the following information:

Job List

Job number                 Memory Requested

J1                                          700k

J2                                          500k

J3                                          740k

Memory List

Memory Block                    Size

Block 1                                 610k

Block 2                                 850k

Block 3                                 700k

a. Use the best-fit algorithm to allocate the memory blocks to the three arriving jobs.

2.a

Memory Block

Memory Block   Size

Job Number

Job Size

Status

Internal Fragmentation

Block 1

650k

J2

500k

Busy

110k

Block 2

 

850k

 

J3

 

740k

 

Busy

 

110k

 

Block 3

700k

J1

700k

Busy

 

0k

Total Available

2200k

Total Used

1940k

 

220k

 












b. Use the first-fit algorithm to allocate the memory blocks to the three arriving.

2.b

Memory Block

Memory Block   Size

Job Number

Job Size

Status

Internal Fragmentation

Block 1

650k

J2

500k

Busy

110k

Block 2

 

850k

 

J1

 

700k

 

Busy

 

110k

 

Block 3

700k

 

 

free

 

 

Total Available

2200k

Total Used

1200k

 

220k

  •        



 


  • J3-idle 

 

 

 

 

 

 

No comments:

Post a Comment