There are disclosed methods for dynamically resizing memory pools used by
database management systems. In one aspect, if a decrease in allocation
to the memory pool is required, at least one page grouping that may be
freed from the memory pool is identified as a candidate based on its
position in a list of page groupings. If the page grouping contains any
used memory blocks, the used memory blocks may be copied from a candidate
page grouping to another page grouping in the list in order to free the
candidate page grouping. Once the candidate page grouping is free of used
memory blocks, the candidate page grouping may be freed from the memory
pool. As an example, this method may be used for dynamically resizing
locklists or lock memory.