Limit cache memory use

The initial, minimum, and maximum cache sizes are all controllable from the database server command line.

  • Initial cache size   You can specify the initial cache size for the database server by using the -c database server option. If you do not specify the -c option, the database server calculates the initial cache allocation.

  • Maximum cache size   You can control the maximum cache size by specifying the database server -ch option. The default is based on a heuristic that depends on the physical memory in your computer. On Windows Mobile, the default maximum cache size is the amount of available program memory minus 4 MB. On other non-Unix computers, this is approximately the lower of the maximum non-AWE cache size and 90% of the physical memory of the computer. On Unix, the default maximum cache size is calculated as follows:

    • On 32-bit Unix platforms, it is the lesser of 90% of total physical memory or 1,834,880 KB.

    • On 64-bit Unix platforms, it is the lesser of 90% of total physical memory and 8,589,672,320 KB.

  • Minimum cache size   You can control the minimum cache size by specifying the database server -cl server option. By default, the minimum cache size is the same as the initial cache size, except on Windows Mobile. On Windows Mobile, the default minimum cache size is 600 KB.

    If you specify the -c server option without -cl, then the minimum cache size is set to the initial cache size specified by the -c server option.

    If you do not set the -c or -cl server options, the minimum cache size is set to a very low hard-coded constant value, so that the cache can shrink if necessary. On Windows this value is 2 MB, on Unix it is 8 MB, and on Windows Mobile it is 600 KB.

Note

If you attempt to set your initial or minimum cache sizes to a value that is less than 1/8 of the maximum cache size, the initial and minimum cache sizes are automatically increased relative to the maximum cache size.

You can also disable dynamic cache sizing by using the -ca 0 server option.

The following database server properties return information about the database server cache:

  • CurrentCacheSize   Returns the current cache size, in kilobytes.

  • MinCacheSize   Returns the minimum allowed cache size, in kilobytes.

  • MaxCacheSize   Returns the maximum allowed cache size, in kilobytes.

  • PeakCacheSize   Returns the largest value the cache has reached in the current session, in kilobytes.

 See also