Internal fragmentation happens when fixed-size memory blocks are allocated, and the process does not use the entire block, leaving some space unused inside the block.
External fragmentation occurs when free memory is split into small pieces scattered between allocated blocks, making it hard to allocate large contiguous blocks.
Internal fragmentation is wasted space inside allocated blocks, while external fragmentation is wasted space outside allocated blocks scattered in small free blocks.
The unused 2 KB inside the allocated block is internal fragmentation because it is wasted space inside allocated memory.
External fragmentation causes free memory to be split into small pieces, so large requests may fail even if total free memory is enough.
