Memory Allocation Strategy When a program requests memory from the operating system (OS) — say for creating variables, arrays, or objects — the OS must decide where in the memory to place this data. This decision-making is known as a Memory Allocation Strategy . In dynamic memory allocation, main memory (RAM) is managed in chunks called blocks . As programs request and release memory, the memory space gets fragmented into free and occupied blocks. So, an important task for the OS is to find an appropriate free block when a program requests memory. To manage this efficiently, different allocation strategies are used. First Fit Memory Allocation Strategy Definition : In the First Fit strategy, the OS searches from the beginning of memory and allocates the first free block that is large enough to satisfy the request. It doesn't check all blocks. As soon as a large enough block is found, allocation happens. Example : Assume free memory blocks of sizes: 200KB , 500KB ,...
Comments
Post a Comment