Configuration

Global configuration of the cache-chroniclemap libModule is done in the gerrit.config file in the site's etc directory.

Information about gerrit caches mechanism can be found in the relevant documentation section.

Chronicle-map supports most of the cache configuration parameters, such as:

  • maxAge: Maximum age to keep an entry in the cache. Gerrit docs

  • refreshAfterWrite: Duration after which we asynchronously refresh the cached value. Gerrit docs

Chronicle-map implementation however might require some additional configuration

Configuration parameters

cache.<name>.avgKeySize : The average number of bytes to be allocated for the key of this cache. If key is a boxed primitive type, a value interface or Byteable subclass, i. e. if key size is known statically, it is automatically accounted by chronicle-map. In this case, this value will be ignored.

Official docs

cache.<name>.avgValueSize : The average number of bytes to be allocated for a value of this cache. If key is a boxed primitive type, a value interface or Byteable subclass, i. e. if key size is known statically, it is automatically accounted by chronicle-map. In this case, this value will be ignored.

Official docs

cache.<name>.entries : The number of entries that this cache is going to hold, at most

Official docs

cache.<name>.maxBloatFactor : the maximum number of times this cache is allowed to grow in size beyond the configured target number of entries.

Chronicle Map will allocate memory until the actual number of entries inserted divided by the number configured through ChronicleMapBuilder.entries() is not higher than the configured maxBloatFactor.

Chronicle Map works progressively slower when the actual size grows far beyond the configured size, so the maximum possible maxBloatFactor() is artificially limited to 1000. Default: 1

Official docs