Reducing memory fragmentation. Memory is allocated during a preboot phase
of a computer system, wherein the memory is allocated based on a
plurality of memory types. Fragmentation of memory is determined, wherein
a fragment includes a contiguous block of memory of the same type. At
least a portion of memory allocated to a firmware module is coalesced
based on the plurality of memory types if the fragmentation is greater
than a threshold. An operating system is booted by the computer system.