Section 15.1. DB2 Memory Allocation: The Big Picture


15.1. DB2 Memory Allocation: The Big Picture

DB2 allocates memory for three different types of operations.

  • Instance-level operations: DB2 allocates memory for instance-level operations such as accepting connection requests, starting up support to activate a database, and for inter-partition communication if you have a multi-partition system. This is known as instance-level shared memory since it is shared by all databases in the instance and by all applications connecting to databases in the instance. Figure 15.1 shows the components that make up the instance-level shared memory in the top left corner (Per Instance Global Control Block).

    Figure 15.1. The DB2 memory model: the big picture


  • Database-level operations: DB2 also allocates a piece of shared memory for every database that has been activated or that has one or more connections. This memory is used for all access to the database, concurrency control on the database, and logging related to the database. This is known as database-level shared memory since it is shared by all applications that are connected to the database. The components that make up the database-level shared memory are shown in the bottom left corner of Figure 15.1 (Per DB).

  • Application/Agent-level operations: For each connection to a database, the agents responsible for handling the requests for the application also need some memory. They need some shared memory for application control heap structures and some private memory for sorting, access plan generation, and so on. These memory areas are known as application shared memory and agent private memory. The components that make up the agent private memory are shown in the middle of Figure 15.1 (Per DB2 Agent).

DB2 allocates its instance-level shared memory for each instance that you start. This is the area on the top left side of Figure 15.1. For every database in the instance that has been activated or that has at least one connection, DB2 will allocate the database-level shared memory. This is the area on the bottom left side of Figure 15.1.

As long as one DB2 agent is connected to a database or is in the idle agent pool, DB2 will allocate and maintain the application shared memory. Every DB2 agent that is either working or in the idle agent pool will have its own agent-level private memory. Figure 15.1 illustrates this (Application Global Memory and Agent Private Memory).



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