Database Cache

To speed-up database access, each client computer can have a separate database cache. This cache has a storage are which gets administered by ObjectStores cache manager (this is the service "ObjectStore Cache Manager").

Cache size gets defined during ClassiX® start. It is not possible to scale up or down the cache during runtime. It shares the RAM (physical memory) with the operating system and with the other programs, which are running on the computer at this time. The golden mean needs to be kept:

It is possible to define cache size with a number of environment variables. All these parameters will be integrated into the formula to calculate cache size:
Cache size= (free physical memory - reserve) * cache factor

Parameter Description Default Unit
CX_FIXED_CACHE_SIZE Sets cache size to a fixed value. The formula is not used. (8) MBytes
OS_CACHE_SIZE s. CX_FIXED_CACHE_SIZE, but different unit! OS_CACHE_SIZE takes priority over  CX_FIXED_CACHE_SIZE. (8 MB) Bytes
CX_TS_CACHE_SIZE If ClassiX® runs on a terminal server, the formula cannot be used. Instead, the cache will be set to a fixed size.  64 MBytes
CX_RESERVED_FOR_APPS Same as the parameter "Reserve".
The parameter controls, how much memory is left for other programs and ClassiX®. ClassiX® needs roughly 32 MBytes (default value).
32 MBytes
CX_CACHE_SIZE_FACTOR Same as the parameter "Cache Factor".
The parameter controls, how much of the free memory minus reserves from above should be used for the cache. The value 100 means everything is reserved for the cache, 0 means no cache (8 MBytes, see below).
25 %

The minimum cache size is 8 MBytes, even if the formula calculates a value below this.

Example

The following environment variables are set:

If ClassiX® gets started on a terminal server, 64 MBytes are reserved for the cache. Otherwise a defined part of the physical memory will be reserved for the cache. For a computer with 280 MBytes free memory (task manager) it will be (280 MB - 48 MB) * 75% = 174 MB. Roughly 74 MB free memory will be left for other programs (280 MB - 174 MB Cache - 32 MB ClassiX® = 74 MB). In case other programs are being started (also controls such as Word or Excel!), they share the remaining memory. The same applies for ClassiX®, when big amounts of transient objects are generates in in larger runs.

To finally check, how large the cache is can be queried by the object manager via function GetCacheSize(). Alternatively it is possible to turn on the logging via environment variable CX_REPORT_STARTUP. ClassiX® documents how the size has been calculated.