next up previous contents index
Next: 15.3 Example use Up: 15.2 Memory regions Previous: 15.2.1 Region flags

15.2.2 Allocation priority

The second attribute associated with each region, the allocation priority, indicates in what order the regions should be searched for free memory to satisfy memory allocation requests. Regions with a higher allocation priority value are preferred over regions with a lower priority.

Allocation priorities are typically useful in two situations. First, one section of a machine's physical memory may provide faster access than other regions for some reason, for example because it is directly connected to the processor rather than connected over a slower bus of some kind. (For example, the Amiga has what is known as ``fast'' memory, which typically supports faster access because it does not contend with ongoing DMA activity in the system.) In this case, if it is not likely that all available memory will be needed, the memory region describing the faster memory might be given higher priority so that the LMM will allocate from it whenever possible.

Alternatively, it can be useful to give a region a lower priority because it is in some way more ``precious'' than other memory, and should be conserved by satisfying normal allocation requests from other regions whenever possible. For example, on the PC, it makes sense to give 16MB memory a lower priority than ``high'' memory, and 1MB memory a still lower priority; this will decrease the likelihood of using up precious ``special'' memory for normal allocation requests which just need any type of memory, and causing memory shortages when special memory really is needed.



University of Utah Flux Research Group