Page Frame Allocation: Difference between revisions

Jump to navigation Jump to search
m
Fix typos
[unchecked revision][unchecked revision]
No edit summary
m (Fix typos)
Line 1:
==Physical Memory Allocators==
 
These are the algorithmalgorithms that will provide you a new page frame when you'll need it. The client of this algorithm is usually indifferent to which frame is returned, and especially, a request for n frames needn't to return contiguous frames.
 
N will be the size of the memory in pages in the following text.
Line 9:
 
* a dword comparison can test up to 32 bits at once and thus speed up allocs
* keeping a pointer to the last allocated bit may improve the performance of the next search (keeping information about the fact all the previous bytes were searched unsucessfullyunsuccessfully)
 
===Stack/List of pages===
Line 59:
===Flat List===
 
One straightforward way to manage big areas of addresses space is a linked-list (as depicted below). Each "free" region is associated with a descriptor giving its size and its base address. When some space needs to be allocated, the list is scanned for a region being large enough with a "first fit" or "best fit" (or watheverwhatever) algorithm. This was e.g. the way memory was managed by MS-DOS. When memory is allocated, the suitable entry is either removed (the whole region is allocated) or resized (only a portion of the region is allocated).
 
Note that with flat linked-lists, both "is memory at address XXX free" or "where can i get a block of size YYY" questions may require a complete traversal of the list to get answered. If virtual memory gets fragmented and the list gets longer, that may become an issue. "Is memory at address XXX free?" is mainly used to merge two free zone into a new (bigger) one when a block is released, and it is easier to deal with if the list is kept ordered by growing addresses.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu