Problem solve Get help with specific problems with your technologies, process and projects.

How does DB2 manage the memory allocations/deallocations in an AIX environment?

How does DB2 manage the memory allocations and deallocations in the AIX environment? Is there a reason that DB2 allocates more memory than configured?

Example, I have a database instance created with five Buffer pools comprising of 10GB and all other configuration parameters related to shared memory and private memory, etc. are summing up to 800MB. While running the application, I can see that DB2 is using the 16GB of physical memory (max RAM installed) and the 4GB of swap. As soon as all the swap is filled, which is 4GB in my case, the operating system kills all the processes and the machine goes into the single user maintenance mode that needs a hard reboot of the machine.

Although I have used DB2 on Unix and Windows platforms (Oracle and SQL Server too, for that matter) I am not an expert on non-mainframe platforms. So I asked Scott Hayes, BMC Software's resident expert on DB2 for Linux, Unix and Windows platforms to contribute an answer to your question.

Scott responds:

Well, without the required details (e.g. configuration information), here are some educated guesses that might help.

With BP allocations that large, I assume you are running DB2 V8 64bit. On a 16GB AIX box, I would allocate at least that much paging space. 4GB is too small. The symptoms you are describing could occur if DB2 is doing private memory sorts (INTRA_PARALLEL is turned OFF) and the following environment variables have not been set by the instance:


Without the DB2MEMDISCLAIM, DB2 will not make a proper effort to release private memory when it is finished with it. The number of connections into DB2 would also have some bearing on memory consumed by the DB2 instance. An easy rule of thumb is 1MB per connection.

You should run the "db2set" command to verify if the AIX environment variables are set and if not, use "db2set DB2MEMDISCLAIM=YES" and "db2set DB2MEMMAXFREE=8192000" commands to properly set them. And, I'd also like to see 20GB of paging space allocated for the operating system.

If this is a data warehouse database with a small number of concurrently executing connections, he could also try using INTRA_PARALLEL=ON which would cause DB2 to do shared memory sorts and exploit CPU parallelism. But, turning this on should be done with great care and in conservative increments to the DFT_DEGREE of parallelism.

Editor's note: Do you agree with this expert's response? If you have more to share, post it in one of our [email protected]/search390>discussion forums.

Dig Deeper on IBM DB2 management