Fragmentation in OS - internal and external fragmentation

By:   Last Updated: in: ,

Operating System: Q1.What is Fragmentation in OS? Q2.What is Internal Fragmentation? Q3.What is External Fragmentation? (Operating System all notes)

Fragmentation-in-OS

Q1. What is Fragmentation in OS?

Ans. Fragmentation in OS: Fragmentation is a phenomenon in which storage space is used inefficiently, reducing capacity or performance and often both. It occurs in a dynamic memory allocation system when many of the free blocks are too small to satisfy any request.

Fragmentation in OS is of 2 types:

(i) External Fragmentation: It happens when a dynamic memory allocation algorithm allocates some memory and a small piece is left over that cannot be effectively used.

(ii) Internal Fragmentation: It is the space wasted inside allocated memory blocks because of the restriction of the allowed sizes of allocated blocks.

Q2. What is Internal Fragmentation? with example?

Ans. Internal Fragmentation: Internal fragmentation occurs when the memory allocator leaves extra space empty inside of a block of memory that has been allocated for a client. This usually happens because the processor's design stipulates that memory must be cut into blocks of certain sizes.

For example, blocks may be required to be evenly be divided by four, eight, or 16 bytes. When this occurs, a client that needs 57 bytes of memory, for example, maybe allocated a block that contains 60 bytes, or even 64.
The extra bytes that the client doesn't need go to waste, and over time these tiny chunks of unused memory can build up and create large quantities of memory that can't be put to use by the allocator. Because all of these useless bytes are inside larger memory blocks, the fragmentation is considered internal.

Q3. What is External Fragmentation? with example?

Ans. External Fragmentation: External fragmentation happens when the memory allocator leaves sections of unused memory blocks between portions of allocated memory.

For example, if several memory blocks are allocated in a continuous line but one of the middle blocks in the line is freed (perhaps because the process that was using that block of memory stopped running), the free block is fragmented.

The block is still available for use by the allocator later if there's a need for memory that fits in that block, but the block is now unusable for larger memory needs. It cannot be lumped back in with the total free memory available to the system, as total memory must be contiguous for it to be useable for larger tasks.

In this way, entire sections of free memory can end up isolated from the whole that is often too small for significant use, which creates an overall reduction of free memory that over time can lead to a lack of available memory for key tasks.




[ Topic= Fragmentation in OS ]
[ Topic= Fragmentation in OS ]
[ Topic= Fragmentation in OS ]



Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.
Facebook = @allbcaweb
(click on it or search "allbcaweb" on Facebook)
Instagram = @allbcaweb
(click on it or search "allbcaweb" on Instagram)
Twitter = @allbcaweb
(click on it or search "allbcaweb" on Twitter)
Email= allbca.com@gmail.com
Send us your query anytime about Fragmentation in OS!


External Links:-

1. Fragmentation in OS - (click here)

[ Topic= Fragmentation in OS ]
[ Topic= Fragmentation in OS ]

No comments:
Write comment