Home | Previous Page | Next Page   Disk, Memory, and Process Management > Shared Memory > Shared-Memory Use >

Shared-Memory Size

Each portion of the database server shared memory consists of one or more operating-system segments of memory, each one divided into a series of blocks that are 8 kilobytes in size and managed by a bit map.

The header-line output by the onstat utility contains the size of the database server shared memory, expressed in kilobytes. For information on how to use onstat, refer to the utilities chapter in the IBM Informix: Administrator's Reference. You can also use the -g seg option of onstat to monitor how much memory the database server allocates for each portion of shared memory.

You can set the SHMTOTAL parameter in the ONCONFIG file to limit the amount of memory overhead that the database server can place on your computer or node. The SHMTOTAL parameter specifies the total amount of shared memory that the database server can use for all memory allocations. However, certain operations might fail if the database server needs more memory than the amount set in SHMTOTAL. If this condition occurs, the database server displays the following message in the message log:

size of resident + virtual segments x + y > z 
   total allowed by configuration parameter SHMTOTAL

In addition, the database server returns an error message to the application that initiated the offending operation. For example, if the database server needs more memory than you specify in SHMTOTAL while it tries to perform an operation such as an index build or a hash join, it returns an error message to the application that is similar to one of the following:

-567    Cannot write sorted rows.
-116    ISAM error: cannot allocate memory.

After the database server sends these messages, it rolls back any partial results performed by the offending query.

Internal operations, such as page-cleaner or checkpoint activity, can also cause the database server to exceed the SHMTOTAL ceiling. When this situation occurs, the database server sends a message to the message log. For example, suppose that the database server attempts and fails to allocate additional memory for page-cleaner activity. As a consequence, the database server sends a message to the message log that is similar to the following:

17:19:13         Assert Failed: WARNING! No memory available for 
                 page cleaners
17:19:13         Who: Thread(11, flush_sub(0), 9a8444, 1)
17:19:13         Results: Database server may be unable to complete a 
                 checkpoint
17:19:13          Action: Make more virtual memory available to database 
                 server
17:19:13         See Also: /tmp/af.c4 

After the database server informs you about the failure to allocate additional memory, it rolls back the transactions that caused it to exceed the SHMTOTAL limit. Immediately after the rollback, operations no longer fail from lack of memory, and the database server continues to process transactions as usual.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]