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.

  • Joachim Müller

    Hello Keith,

    Thanks fist to you for the very good explanation. I've learned a lot about db2top.
    The FCMBP memory pool is not correct. What we see, is that we have to divide the Memory Pool by the number of
    partitions. See out output:
    [-]15:22:44,refresh=2secs(0.202) Memory AIX,part=[16/16],DB2TBP:TBP
    [d=Y,a=N,e=N,p=ALL] [qp=off]

    ┌──────────────┬────────────┬────────────┬────────────┬───────────┐
    Self Tuning……: Off │ │ 25%│ 50%│ 75%│ 100%│ Sort Heap……..: 0
    Sort HWM………: 0 │Memory hwm% │————————————————–│ Private Mem……: 610.7M
    Lock List……..: 355.4K │Sort Heap% │ │ Private Sort…..: 0
    Shared Sort……: 488.0K │Mem Skew% │ │ Shared Sort HWM..: 474.2M
    Private Work HWM.: 0 │Pool Skew% │ │ PkgCache HWM…..: 776.5M
    Catalog Cache HWM: 20.0M └──────────────┴──────────────────────────────────────────────────┘ Shared Work HWM..: 0

    Memory Memory Percent Current High Percent Maximum # of
    Type Level Pool Total Size WaterMark Max Size Pool(s)
    ———– ———- ——————– ——- ———— ———— ——- ———— ——-
    Instance DB2TBP Monitor 0.01% 6.3M 6.3M 105.21% 6.0M 16
    Instance DB2TBP FCMBP 69.16% 52.0G 52.0G 3982.23% 1.3G 16
    Instance DB2TBP Other 23.86% 17.9G 17.9G 375.98% 4.7G 16
    Database TBP Applications 0.23% 178.4M 257.8M 28.35% 629.5M 1259
    Database TBP Database 1.25% 965.6M 965.8M 60.18% 1.5G 16
    Database TBP Lock Mgr 0.77% 595.1M 595.1M 99.83% 596.1M 16
    Database TBP Utility 0.00% 2.3M 320.4M 0.37% 625.0M 16
    Database TBP Package Cache 1.40% 1.0G 1.2G 3.30% 32.0G 16
    Database TBP Catalog Cache 0.09% 72.2M 75.8M 0.01% 512.0G 16
    Database TBP Other 0.00% 3.0M 3.0M 0.94% 320.0M 16
    Database TBP BufferPool 2.78% 2.0G 2.0G 0.07% 3.0T 96
    Database TBP SharedSort 0.05% 34.9M 392.2M 6.56% 532.5M 16
    Database TBP ApplShrHeap 0.09% 65.7M 92.6M 5.26% 1.2G 16
    Application TBP Applications 0.23% 178.4M 257.8M 28.35% 629.5M 1259
    Application TBP Other 0.08% 58.0M 73.6M 0.00% 4.5T 147

    There is 52 GB of FCMBP, to much. we have only 32GB physical memory.

    Thanks again and have a nice weekend.

    I looking forward to see your next db2top screen;-)

    Best regards,
    Joachim Müller

  • thekguy

    Hi Joachim,

    Thank you for your comment. You are correct that the db2top Memory screen sums the memory of the FCMBP pool across all partitions. This is true for all pool types. I am updating the post to take this into account.

  • Pingback: Do db2top High Watermarks Give Wrong Answers? « The K Guy()