Go’LegOS. Alternative Memory Management Schemes for LegOS Project. Hao Ji Yanhao Zhu Gowri Mereddy. Problem Statement.
Alternative Memory Management Schemes for LegOS Project
The unit of the memory is 2 byte word
4 bytes Head
Consisting of Process ID and Size
Size indicating the length of Data Field
The Memory is searched from the mm_start till the end to find a free memory which is of the nearest size to the required size. This type of technique leads to minimize external fragmention,but may lead to lot of internal fragmentations.
The memory is searched to find the biggest whole available and the split into two parts so that the other process can use the space. May be a solution to internal fragmentation.
The alteration of the First fit is the next fit. Never it finds the hole it stores the location, and when requested for allocation starts allocating from that position
#define BEST_FIT 2, #define WORST_FIT 3
if (mm_policy == FIRST_FIT) return malloc_first_fit(size);
If (mm_policy == NEXT_FIT) return malloc_next_fit(size);
if (mm_policy == BEST_FIT) return malloc_best_fit(size);
if (mm_policy == WORST_FIT) return malloc_worst_fit(size);
we got crazy when pressing the button for hundreds of times to keep record of our testing result.