When we perform monitoring checks on the memory usage of db2, we often need to know the current memory usage of db2. The instance_memory parameter cannot be used to accurately view the information, because instance_memory includes mon_heap, memory and FCM, database shared memory segment (bufferpool, locklist, dbheap, pckcache, util_heap, catgalocache) these memory pool sets, and db2mtrk can specify the database and instance level to view Real-time memory usage
Therefore, in DB2, The db2mtrk tool is a very good tool to view the current memory usage.
Command syntax of db2mtrk: (there may be slight differences between unix, linux, and Windows platforms)
Db2inst1 @ marven ~] $ Db2mtrk-h
Usage: db2mtrk-I |-d |-a |-p [-m |-w] [-v] [-r interval [count] [-h]
-I Display instance level memory usage
-D Display database level memory usage
-A Display application level memory usage
-P Display agent private memory usage
-M Display maximum usage information
-W Display watermark usage information
-V Display verbose memory usage information
-R Run in repeat mode
Interval Amount of seconds to wait between reports
Count Number of reports to generate before quitting
-H Display this help screen
Notes:
1. One of-I-d-a-p must be specified.
2. The-w and-m flags are optional. An invocation of the application
Is invalid if both flags are specified.
3. The-m flag reports the maximum allowable size for a given heap
While the-w flag reports the largest amount of memory allocated
From a given heap at some point in its history.
Usage scenarios:
Db2mtrk-I-d
Report current memory usage for instance and all databases
Db2mtrk-I-p-m
Report maximum allowable size for instance and agent private memory
Db2mtrk-p-r 1 5
Report agent private memory five times at one second intervals
Heap Legend:
When running in normal mode (I. e.-v flag not specified) heaps are named
Using the following codes:
Agsh-Application Group Shared Heap lockh-Lock Manager Heap
Appctlh-Application Control Heap monh-Database Monitor Heap
Apph-Application Heap other-Other Memory
Appshrh-Applications Shared Heap pckcacheh-Package Cache
& Apos;-Buffer Pool Heap queryh-Query Heap
Catcacheh-Catalog Cache Heap shsorth-Shared Sort Heap
Dbh-Database Heap sorth-Sort Heap
Dlfmh-DFM Heap stath-Statistics Heap
Fcmbp-FCMBP Heap stmth-Statement Heap
Ip-Import Pool utilh-Backup/Restore/Util Heap
-M parameter option is to display the maximum memory usage online
-W Parameter options are used to display the maximum memory used during use, both watermark
-R parameter option is repeated display interval is repeated display time interval count is the number of times to be repeated display