Prevent Memory Fragmentation
Posted: Fri Jun 01, 2007 5:06 am
I deleted all the code I had previously written for my physical memory manager and started from scratch. I coded the initialization and allocation for today and tomorrow will finish the deallocation and etc.
Now what my memory manager does is that it finds a block of of pages as big as the requested number of pages in the available memory space and then allocates that for the user (if the user has requested the pages to be committed and not reserved). However, I am wondering about fragmentation that will happen after allocating and deallocating a lot of memory. What are the ways of preventing scattered memory and fragmentation while managing the memory? I'd appreciate it if someone could give me some insights.
Now what my memory manager does is that it finds a block of of pages as big as the requested number of pages in the available memory space and then allocates that for the user (if the user has requested the pages to be committed and not reserved). However, I am wondering about fragmentation that will happen after allocating and deallocating a lot of memory. What are the ways of preventing scattered memory and fragmentation while managing the memory? I'd appreciate it if someone could give me some insights.