Section 15.2. Instance-Level Shared Memory


15.2. Instance-Level Shared Memory

When you start a DB2 instance using the db2start command, DB2 allocates the instance-level shared memory for the instance, and this remains allocated until you stop the instance using the db2stop command. The instance-level shared memory for the instance is shown in the top left corner of Figure 15.2. DB2 uses this memory to manage and coordinate database and agent activity for all applications running against all databases in the instance.

Figure 15.2. Instance-level shared memory


In a nonpartitioned DB2 instance, this memory contains information used by:

  • The Snapshot and Event Monitors

  • The audit logging facility

  • The DB2 trace facility

In a partitioned DB2 instance, this memory also contains information used by the Fast Communications Manager (FCM), which is used for inter-partition communication. The amount of memory required for FCM communications depends on how you set up your multi-partition database system. If you have one partition per server, DB2 requires less memory for FCM since all communications use the TCP/IP interconnect. If you have more than one database partition within a server (also known as logical partitions), DB2 uses a segment of shared memory for FCM communications; this can greatly increase the amount of memory consumed at the instance level.

The Database Manager Configuration parameter INSTANCE_MEMORY controls how much memory can be allocated for the instance shared memory. By default this is set to automatic, which allows DB2 to calculate how much memory is required. If you want to limit or control the amount of memory that can be allocated, you can set this to a specific value. However, you need to be aware that this can impact performance, especially for a multi-partitioned database with logical partitions: setting too large a value can cause excessive paging, and too low a value can restrict the memory that DB2 can allocate.

If INSTANCE_MEMORY is set to AUTOMATIC, you can determine its effective value using the command:

 db2 get dbm cfg show detail 

If the instance is not started, this will only show the value AUTOMATIC, so remember to start the instance before running this command.

The following output of the get dbm cfg command shows that the instance memory is using 10,313 pages, or 42MB of memory (10,313 pages x 4,096 bytes per page).

 Size of instance shared memory (4KB) (INSTANCE_MEMORY) = AUTOMATIC(10313)         AUTOMATIC(10313) 

The INSTANCE_MEMORY configuration parameter is only a limit for the instance shared memory, and typically it is not fully allocated. To find out the amount of memory actually used by the instance, use the DB2 memory tracker tool, db2mtrk:

 db2mtrk i v Memory for instance   FCMBP Heap is of size 17432576 bytes   Database Monitor Heap is of size 180224 bytes   Other Memory is of size 3686400 bytes   Total: 21299200 bytes 

This example shows that although 42MB of memory is reserved for the instance shared memory set, only about 21MB is being used at the time db2mtrk is run. If the instance is not started, db2mtrk returns that no memory is being used.

NOTE

The memory that DB2 allocates for the DB2 trace facility is not counted toward the INSTANCE_MEMORY configuration parameter. DB2 reserves this memory so that it can allocate it at any time in case you need to take a DB2 trace.




Understanding DB2(R. Learning Visually with Examples)
Understanding DB2: Learning Visually with Examples (2nd Edition)
ISBN: 0131580183
EAN: 2147483647
Year: 2004
Pages: 313

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net