+ 1
How to design a memory management system
Hi I need idea how to implement the memory management system. I am not able to proceed with..... Can anyone suggest some hint ? Below is problem statement : Decide a memory management system which devides memory into continous chunk of size 4k , 16k , 64 k and 2M. Memory manager then pre allocate 80% of free memory from system to the defined chunk. Solution must provide interface which should replace calloc and malloc and must be used by memory management system user ... This memory management should also run periodic clean up to reclaim freed up memory and identify the contiguous memory chunk in its allocated memory region.
1 Antwort
+ 2
The term you're looking for is a "Memory Allocator".
Memory allocators are quite a complex subject that won't fit into a single reply, so here are a couple of sources for reference:
Wikipedia page: https://en.wikipedia.org/wiki/Memory_management
Example implementation of different algorithms: https://github.com/mtrebi/memory-allocators
The specific algorithm in your case is the "Buddy Allocation": https://en.wikipedia.org/wiki/Buddy_memory_allocation