db2top Memory Screen (Part 1)

Computer RAM

A well-tuned DB2 for LUW system strikes a careful balance among the various consumers of resources such as CPU, disk, and memory. Applications, utilities, and internal database processes all compete for limited memory resources. The db2top tool can give you insight into your biggest memory consumers using the Memory screen, which we will examine in today’s post.

You launch the Memory screen by pressing the ‘m’ key. When the screen is between 80 and 140 columns wide, it takes the form of the usual combination of a set of gauges and a table, as shown below:

db2top Memory screen at 80 columns wide
db2top Memory screen at 80 columns wide

The gauges are as follows:

Gauge Name Gauge Type Definition
Memory hwm% Normal
The sum of the memory usage high watermarks across all types of memory pool during the interval as a percentage of the highest such sum since the time this screen was first launched.

sum(pool_watermark) / max(sum(pool_watermark)), where sum() means summing across all memory pools across all partitions and max() means finding the maximum since the memory pool screen was first launched.

Sort Heap% Normal The percentage of the sort heap threshold that is allocated for all sorts at the database level at the time the snapshot was taken (sort_heap_allocated/sheapthres).
Mem Skew% Normal A measure of asymmetry in the distribution of total memory pool consumption among partitions.

1 – ((nodesum(poolsum(pool_cur_size))/nodecount) / max(poolsum(pool_cur_size)), where nodesum() means summing across all partitions, poolsum() means summing across all memory pools, nodecount means the number of partitions of the database, and max() means the maximum out of all partitions

Pool Skew% Normal A measure of asymmetry in the distribution of memory pools among partitions.

1 – ((sum(poolcount)/nodecount) / max(poolcount), where sum() means the sum across all partitions, max() means the maximum out of all partitions, nodecount means the number of partitions of database, and poolcount means the number of pools on a partition

The table columns are as follows:

db2top Memory screen table columns

Column Name Definition
Memory Type

Displays one of three possible values:

  • Instance – indicates that this row contains instance related information
  • Database – indicates that this row contains database related information
  • Application – indicates that this rows contains application information for all applications connected to the database
Level If the memory type is “Instance”, the name of the instance is shown. Otherwise, the name of the database is shown.
Memory Pool

The type of memory pool (pool_id). It can have one of the following values:

  • Applications
  • Database
  • Appl Control
  • Lock Mgr
  • Utility
  • Statistics
  • Package Cache
  • Catalog Cache
  • Dfm
  • Query
  • Monitor
  • Statement
  • FCMBP
  • Import
  • Other
  • BufferPool
  • ApplGroup
  • SharedSort
  • SortHeap
  • Unknown[x] where x is the pool ID
Percent Total The percentage of the total memory consumed across all memory pools that is consumed by memory pools of this type (sum(pool_cur_size) / sum_all(pool_cur_size) × 100%, where sum() means summing across all memory pools of this type and sum_all() means summing across all memory pools).
Current Size The current amount of memory in use by memory pools of this type (sum(pool_cur_size) where sum() means summing across all memory pools of this type, even across partitions). Shown in bold yellow text when it has shrunk since the last measurement. Shown in bold green text when it has grown since the last measurement.
High Watermark The sum of the high watermarks of memory usage since creation for all memory pools of this type (sum(pool_watermark), where sum() means summing across all memory pools of the same type, even across partitions). Expressed in units that are a multiple of bytes (e.g. KB, MB, etc.). Shown in bold green text when the sum of the high watermarks has increased since the previous measurement.
Percent Max The percentage of configured memory for all memory pools of this type that is in use (sum(pool_cur_size) / sum(pool_max_size) × 100%, where sum() means summing across memory pools of the same type, even across partitions).
Maximum Size The internally configured memory for all memory pools of this type (sum(pool_max_size), where sum() means summing across all memory pools of the same type, even across partitions). Expressed in units that are a multiple of bytes (e.g. KB, MB, etc.).
# of Pool(s) The number of memory pools of this type.

When the screen width is increased to 141 columns or wider, a column of names and values appears to the left of the set of gauges and another column of names and values appears to the right, as shown below:

db2top Memory screen at 141 columns wide
db2top Memory screen at 141 columns wide

In an upcoming post, we will examine each of these aggregates.