Administration Guide

Memory Model

Memory is important because it has a significant impact on how work gets done within the database. How you divide the available memory amongst those areas within the database is a primary way to control how well your database performs. You control this division of memory among the different heaps through configuration parameters. We will present the key configuration parameters and what part of memory they control in this section. See How DB2 Uses Memory for more information on this topic.

All engine dispatchable units (EDUs) in a partition are attached to the Instance Shared Memory. All EDUs doing work within a database are attached to that database's Database Shared Memory. All EDUs working on behalf of a particular application are attached to an Application Shared Memory region for that application. This type of shared memory is only allocated if intra- or inter-partition parallelism is enabled. Finally, each EDU has its own private memory.

Instance Shared Memory (also known as Database Manager Shared Memory) is allocated when the database is started. From the Instance Shared Memory all other memory is attached/allocated. If Fast Communication Manager (FCM) is used there are buffers taken from this memory. FCM is used for internal communications, primarily messages, both among and within the database servers in a particular database environment. When the first application connects or attaches to a database, Database Shared, Application Shared, and Agent Private memory areas are allocated.

Database Shared Memory (also known as Database Global Memory) is allocated when a database is activated or connected to for the first time. This memory is used across all applications that might connect to the database. Many different memory areas are contained in database shared memory including:

The database manager configuration parameter numdb specifies the number of local databases that can be concurrently active. In a partitioned database environment, this parameter limits the number of active database partitions on a database partition server. The value of the numdb parameter may impact the total amount of memory allocated.

Application Shared memory (also known as Application Global Memory) is allocated when an application connects to a database. This allocation occurs only in a partitioned database environment, or if the database manager configuration parameter intra_parallel is enabled. This memory is used by agents working on behalf of the application to share data and coordinate activities amongst themselves.

The database configuration parameter maxappls sets an upper limit to the number of applications that connect to a database. Since each application that attaches to a database causes some private memory to be allocated, allowing a larger number of concurrent applications will potentially use more memory.

To a certain extent, the maximum number of applications is also governed by the database manager configuration parameter maxagents (or max_coordagents for parallel environments). The maxagents parameter sets an upper limit to the total number of database manager agents in a partition. These database manager agents include active coordinator agents, subagents, inactive agents, and idle agents.

Agent Private Memory is allocated for an agent when that agent is assigned to work for a particular application. The agent private memory is allocated for the agent and contains memory allocations that will be used only by this specific agent, such as the sort heap and the application heap.

There are a few special types of shared memory:

Figure 76. Buffer Pools and Extended Storage


BPE00000

Extended storage acts as an extended look-a-side buffer for the main buffer pool(s). See Extending Memory for more information on this topic. It can be much larger than 4 GB and is an excellent way to exploit machines with large amounts of main memory. The extended storage cache is defined in terms of memory segments.

You should be aware when deciding to use some of the real addressable memory as an extended storage cache that this memory can then no longer be used of other purposes on the machine such as a jfs-cache or as process private address space. Assigning additional real addressable memory to the extended storage cache could lead to higher system paging.

The following database configuration parameters influence the amount and size of the memory available for extended storage:

Each table space is assigned a buffer pool. An extended storage cache must always be associated with one or more specific buffer pools. The page size of the extended storage cache must match the page size of the buffer pool it is associated with.

See Extending Memory for more information on the extended storage cache.


[ Top of Page | Previous Page | Next Page ]