Memory is the most important consideration when you are configuring Adaptive Server. Memory is consumed by various configuration parameters, the procedure cache, statement cache, and data caches. Setting the values of the various configuration parameters and the caches correctly is critical for good system performance.
The total memory allocated during system start-up is the sum of memory required for all the configuration needs of Adaptive Server. This value can be obtained from the read-only configuration parameter total logical memory. This value is calculated by Adaptive Server. 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 server start-up, 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 will be based on the value of max memory. The configuration parameter allocate max shared memory enables a system administrator to allocate the maximum memory that is allowed to be used by Adaptive Server, during server start-up.
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.
The configuration parameter allocate max shared memory can be turned on during start-up and runtime to allocate all the shared memory up to max memory with the least number of shared memory segments. A large number of shared memory segments has the disadvantage of some performance degradation on certain platforms. Check 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 server is restarted.
The difference between max memory and total logical memory is additional memory available for the procedure and statement caches, data caches, or for other configuration parameters.
The amount of memory to be allocated by Adaptive Server during start-up, is determined by either total logical memory or max memory. If this value too high:
Adaptive Server may not start if the physical resources on your machine are not sufficient.
If it does start, the operating system page fault rates may rise significantly and the operating system may need to be reconfigured to compensate.
Handling wider character literals requires 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 have 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 slightly degrades the server’s performance.
When Adaptive Server uses larger logical page sizes, all disk I/Os are performed 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 and statement cache, and the data cache. Figure 3-5 shows how memory is divided.