
上圖是DB2 Memory structure 很重要
在使用資料庫上,我深深覺得Memory control 決定了系統的穩定與否,因此我看到了這圖覺得自己又學了更多,以下是節錄IBM文件說明
基本上是建構在32bit上
We will discuss each of these memory sets in detail.
There is one instance shared memory set per DB2 instance. Instance shared memory is allocated when the database manager is started (db2start), and freed when the database manager is stopped (db2stop). It is used for instance level tasks such as monitoring, auditing and inter-node communication. The following database manager configuration (dbm cfg) parameters control the limits to the instance shared memory and its individual memory pools:
- Instance memory (instance_memory)
- Monitor heap (mon_heap_sz): for monitoring use.
- Audit Buffer (audit_buf_sz): for use of the db2audit facility.
- Fast Communication buffers (fcm_num_buffers): for inter-node communication between partitions and agents. Partitioned instances or instances with INTRA_PARALLEL set to ON
-
The instance_memory parameter specifies the amount of memory reserved for instance management. The default value is AUTOMATIC. This means DB2 will calculate the amount of instance memory needed for the current configuration, based on the sizes of the monitor heap, audit buffer and the FCM buffers. In addition, DB2 will also allocate some additional memory for overflow buffer. The overflow buffer is used to satisfy peak memory requirements for any heap in the instance shared memory region whenever a heap exceeds its configured size. In this case, the settings for the individual heaps are soft limits; they can grow during memory usage peaks.
-
If instance_memory is set to a number, then the larger of instance_memory or the sum of mon_heap_sz, audit_buf_sz and fcm_num_buffers will be used. In this case, you are setting a hard limit to the instance memory, as opposed to a soft limit. When this limit is reached, you will get memory allocation errors. For this reason, it is recommended to leave the instance_memory setting as AUTOMATIC.
If instance_memory is set to AUTOMATIC, it is possible to determine its value using the following commands:
- db2 attach to instance_name (where instance_name is the name of the instance)
- db2 get dbm cfg show detail
-
The instance_memory parameter only sets the limit for the instance shared memory. It does not tell you how much memory is currently being used. To find out the memory usage of an instance, use the DB2 memory tracker tool, db2mtrk. For example,
- db2start
- 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
The above example showed that although 42 MB is memory is reserved for the instance shared memory set, only about 21 MB is being used at the time db2mtrk is run.
Note: In some cases the size displayed by the db2mtrk tool will be larger than the value assigned to the configuration parameter. In such cases, the value assigned to the configuration parameter is used as a soft limit, and the pool's actual memory usage might grow beyond the configured size

<< Home