Browse Prior Art Database

Dynamic Memory Allocation for Multiple Concurrent Sorts

IP.com Disclosure Number: IPCOM000106759D
Original Publication Date: 1993-Dec-01
Included in the Prior Art Database: 2005-Mar-21
Document File: 2 page(s) / 113K

Publishing Venue

IBM

Related People

Bezviner, DE: AUTHOR [+2]

Abstract

A database administrator on an OS/2* Database Manager* can define the amount of storage allocated for a sort to be anywhere from 32K bytes to 2M bytes. (This is called the "sort heap size".) There may be multiple sorts done concurrently per database on the system, and there may be several databases active on the system as well. Since each sort requires a sort heap, a system may have a very large amount of space set aside for sorting.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 47% of the total text.

Dynamic Memory Allocation for Multiple Concurrent Sorts

      A database administrator on an OS/2* Database Manager* can
define the amount of storage allocated for a sort to be anywhere from
32K bytes to 2M bytes.  (This is called the "sort heap size".)  There
may be multiple sorts done concurrently per database on the system,
and there may be several databases active on the system as well.
Since each sort requires a sort heap, a system may have a very large
amount of space set aside for sorting.

      If not enough space is allocated for a sort, the sort will take
longer than necessary.  If too much space is allocated, the sort will
run quickly, but some space will be wasted.  If too much wasted space
is allocated, the system may begin paging to disk, which slows down
the performance of the entire system.  Thus there is a trade-off
between overall system performance and individual sort performance.

      Previously, the only way to affect the trade-off was by setting
the sort heap size at configuration time.  That was a good solution
for single but not multiple sort environments.

      The solution discussed here is a method which monitors how much
space is allocated for sorts, and dynamically adjusts the space
allocated for sorts.  This method takes into account the effect of
both the size of allocation units (heap size) and the level of
concurrency.  A result is optimal sort performance while minimizing
impact on overall system performance due to memory contention.

      This method is based on the idea of obtaining maximum
performance for sorts by giving them as much memory as possible until
a point is reached where it will start impacting performance of other
activity on the system.  Two main factors affect this: 1) Amount of
memory allocated per sort (sort heap size).  2) Number of sorts
concurrently active.

      For this method one must first keep track of space currently
allocated at any one time for sorts on the system.  This is a factor
of the number of sorts running and how much sort heap is allocated
for each sort.  Second, one must determine a threshold for sort space
in the system.  This threshold is based on the sort heap size
specified by the system administrator.  And finally, the sort heap
size cannot be allowed to be too small, or sort performance will be
excessively degraded.  So one should also have a minimum sort heap
size, and if the newly calculated heap size is smaller than that,
then allocate the minimum size instead.

      In operation, when a sort is started a check is made to see if
sort allocations have reached the threshold limit.  If they haven't,
the sort is allowed to allocate up to the maximum sort heap size.
Once the threshold is reached, one calculates a smaller sort heap
size, based on both the original sort heap size and on how much over
the threshold the system currently is.  This new heap size is then
allocated instead of the original one.  This red...