This is a multipart blog article series, and in this series I am going to explain you the concepts of operating system. This article series is divided into multiple modules and this is the fifth module which consists of 26 articles.
In this article we will see a question on contiguous memory management and will try to understand its concepts.
Question: Calculate the time at which J7 will be completed. (Algorithm is best-fit)
| Request No. | J1 | J2 | J3 | J4 | J5 | J6 | J7 | J8 |
|---|---|---|---|---|---|---|---|---|
| Request size | 2 KB | 14 KB | 3 KB | 6 KB | 6 KB | 10 KB | 7 KB | 20 KB |
| Usage | 4 | 10 | 2 | 8 | 4 | 1 | 8 | 6 |
- 17
- 19
- 20
- 37
Answer:
- (ii) 19
- We will put
J1at location3in memory, the internal fragmentation is zero. It will execute for4unit of time.
- Now, we will put
J2in memory at location2, where it will get execute for10 unitsof time. At present the internal fragmentation at memory location2is of6 KB. - Now, we put
J3in memory location0, where it will get executed for2 unitof time. At present the internal fragmentation at memory location at0is1 KB. - Then
J4will arrive, we put it in memory location1, where it will get executed for8 unitsof time. At present the internal fragmentation at memory location1is2 KB. - We want to put
J5in memory but there is no empty slot. So, we will wait untilJ4gets terminated and then we will placeJ5at memory location1, where it will get executed for4 unitsof time. - Now we want to put
J6in memory but there is no empty slot that can accommodateJ6. So we will wait tillJ2gets completed and then we will placeJ6at memory location2. Where it will be executed for1 unitof time. - We want to put
J7in memory but again there is no empty slot which can accommodateJ7. So we will wait tillJ6gets completed and then placeJ7at memory location2, where it will get executed for8 unitof time. - Therefore
J7will be completed at time unit19and time at whichJ7enters RAM is11.
So this was a simple question of contiguous memory management. Hope you liked it and learned something new from it.
If you have any doubt, question, quires related to this topic or just want to share something with me, than please feel free to contact me.
📱 Contact Me
Twitter
LinkedIn
Telegram
Instagram


Top comments (0)