What is the process works from external to internal in operating system?
The user of a computer continuously load and unload the processes from the main memory. Processes are stored in blocks of the main memory. When it happens that there are some free memory blocks but still not enough to load the process, then this condition is called fragmentation.
Fragmentation is a condition that occurs when we dynamically allocate the RAM to the processes, then many free memory blocks are available but they are not enough to load the process on RAM.
Advantages of Fragmentation
Failures: Without fragmentation, if we have no sequential free space, then the write operation will fail.
Faster data writes: Faster data writes due to short fragments.
Optimization of memory Storage: Fragmentation focus is to use every part of memory without wasting the memory.
Disadvantages of Fragmentation
Slower read times: Due to fragmentation, the amount of time it takes to read a non-sequential file can grow and can lead to slow read.
Need for regular defragmentation. Sometimes we need to defragment the memory.
There are two types of fragmentation;
- External fragmentation
- Internal fragmentation
External Fragmentation
Total free RAM space is enough to load a process but the process still can’t load because free blocks of RAM are not contiguous. In other words, we can say that all free blocks are not located together. For example, in the following diagram, we have a total 10 KB space free but it is not together located, so if a process with 10KB size wants to loads on the RAM, then can’t load due to external fragmentation. But in the diagram on the right side we can see that 10KB space is contiguously free, so here if a process of 10KB wants to load on the RAM then can execute.
Internal Fragmentation
When the memory assigned to the process is greater as compared to the memory requested by the process.
The memory must be partitioned into variable sized blocks. Further, assign the best-fit block to the process.
