On UNIX operating systems, after the initial application memory size is allocated during database activation, DB2 allocates more memory as needed to support dynamic memory requirements. Extra memory allocation is subject to any specified fixed size limit. All application memory is allocated as shared memory and is retained until the database deactivates. The total allocated shared memory counts towards only virtual memory usage. While this virtual memory does not require backing by real memory, virtual memory does require backing by swap or paging space on some operating systems. For details about operating system support, see the Operating System Support section.
On Windows operating systems, application memory is allocated as private memory. Application memory allocation is subject to any specified fixed size limit. Memory allocations no longer in use might be freed dynamically or retained for reuse. All outstanding memory allocations are freed when the database deactivates.
Committed memory is memory that is backed by the operating system. Allocated memory is committed as required by memory pools. Committed memory no longer required by memory pools is either cached to improve performance or released to the operating system. Memory is also released or decommitted as necessary if the application memory size is decreased dynamically. All committed memory is released when the database deactivates.
It is recommended to leave appl_memory set to the default of AUTOMATIC. An insufficient fixed application memory setting results in various out of memory failures that are returned to applications. Setting a fixed memory value must be done only after thorough testing to determine peak requirements. Application memory is not tuned by the Self Tuning Memory Manager (STMM), but STMM tunes database_memory, if database_memory is enabled for self-tuning, to compensate for fluctuating application memory requirements.
Operating System | Available support |
---|---|
AIX | Uses medium (64K) pages by default, which can benefit performance. Large (16MB) pages are also allowed on AIX only.1 |
HP-UX | Allocated shared memory requires backing by virtual swap. |
Linux | Allocated shared memory counts towards the virtual shared memory limit (shmall). |
Solaris | Allocated shared memory requires backing by virtual swap and counts towards any virtual memory limits. |
Windows | No additional considerations for the Windows platform. |
Note:
|
db2 "select member, substr(db_name,1,10)as db_name, substr(memory_set_type,1,10) as set_type,
memory_set_size, memory_set_committed, memory_set_used, memory_set_used_hwm
from table(mon_get_memory_set('APPLICATION')"
Returns the
following information:MEMBER DB_NAME SET_TYPE MEMORY_SET_SIZE MEMORY_SET_COMMITTED MEMORY_SET_USED MEMORY_SET_USED_HWM
------ ---------- ---------- -------------------- -------------------- -------------------- --------------------
0 SAMPLE APPLICATION 154927 68616 67829 68616
0 TEST APPLICATION 238092 123404 123404 123404
2 record(s) selected.
In this case, the application memory set is using 154927KB of instance_memory(MEMORY_SET_SIZE) and 68616KB of system memory (MEMORY_SET_COMMITTED), of which 67829KB (MEMORY_SET_USED) is assigned to memory pools.
db2pd -db <database_name> -memsets -mempools, db2pd -dbptnmem