Memory is the most important consideration when you are configuring Adaptive Server. Memory is consumed by various configuration parameters, procedure caches, and data caches. Correctly setting the values of the configuration parameters and the caches is critical to good system performance.
The total memory allocated during start up is the sum of the memory required for all the configuration needs of Adaptive Server. You can obtain this value, which is accumulated by Adaptive Server from the read-only configuration parameter total logical memory. The configuration parameter max memory must be greater than or equal to total logical memory. max memory indicates the amount of memory you will allow for Adaptive Server needs.
During boot-time, by default, Adaptive Server allocates memory based on the value of total logical memory. However, if the configuration parameter allocate max shared memory has been set, then the memory allocated is based on the value of max memory. This allows a system administrator to tell Adaptive Server to allocate, at boot-time, the maximum allowed, which may be considerably more than the value of total logical memory at that time.
The key points for memory configuration are:
The system administrator should determine the size of shared memory available to Adaptive Server and set max memory to this value.
You cannot turn on the configuration parameter allocate max shared memory during at start up and run-time to allocate all the shared memory up to max memory with the fewest number of shared memory segments. This may improve performance, because operating with a large number of shared memory segments may cause performance degradation on certain platforms. See your operating system documentation to determine the optimal number of shared memory segments. Once a shared memory segment is allocated, it cannot be released until the next time you start Adaptive Server.
Configure the different configuration parameters, if the defaults are not sufficient.
The difference between max memory and total logical memory is additional memory available for procedure, for data caches, or for other configuration parameters.
The amount of memory to be allocated by Adaptive Server during boot-time is determined by either total logical memory or max memory. If this value is too high:
Adaptive Server may not start, if the physical resources on your machine are not insufficient.
If it does start, the operating system page fault rates may rise significantly and you may need to reconfigure the operating system to compensate.
The System Administration Guide provides a thorough discussion of:
How to configure the total amount of memory used by Adaptive Server.
Configurable parameters that use memory, which affects the amount of memory left for processing queries.
Handling wider character literals, which require Adaptive Server to allocate memory for string user data. Also, rather than statically allocating buffers of the maximum possible size, Adaptive Server allocates memory dynamically. That is, it allocates memory for local buffers as it needs it, always allocating the maximum size for these buffers, even if large buffers are unnecessary. These memory management requests may cause Adaptive Server to experience a marginal loss in performance when handling wide-character data.
If you require Adaptive Server to handle more than 1000 columns from a single table, or process over 10000 arguments to stored procedures, the server must set up and allocate memory for various internal data structures for these objects. An increase in the number of small tasks that are performed repeatedly may cause performance degradation for queries that deal with larger numbers of such items. This performance hit increases as the number of columns and stored procedure arguments increases.
Memory that is allocated dynamically (as opposed to restarting Adaptive Server to allocate the memory) slightly degrades the server’s performance.
When Adaptive Server uses larger logical page sizes, all disk I/Os are done in terms of the larger logical page sizes. For example, if Adaptive Server uses an 8K logical page size, it retrieves data from the disk in 8K blocks. This should result in an increased I/O throughput, although the amount of throughput is eventually limited by the controller’s I/O bandwidth.
What remains after all other memory needs have been met is available for the procedure cache and the data cache. Figure 5-1 shows how memory is divided.
Figure 5-1: How Adaptive Server uses memory