Memory Calculation for Cache
When considering memory for cache consider the a couple scenarios.
- Memory available for Local and Near caches = heap storage Assume, it is A.
- Memory available for Near and Distributed caches = Memory - heap storage Assume, it is B.
In these scenarios, the memory assigned to any cache is calculated as follows:
- If the Limit is specified, the ListSize is ignored. Limit is the whole number and a percent. The minimum value is
1 and the maximum value is
99. However, a fraction is also supported with a single digit. The minium value is
0.1 and the maximum value is
99.9.
[(Limit/100) * B]/ObjectSize = Capacity
In this case, the capacity is a number of objects available in a cache.
- If the Limit and ListSize are not specified, the memory for Local cache is set to default 100 value. For Distributed cache, no default value is set.
- Capacity = List Size, if specified.
- For the Distributed cache, if ListSize is not specified,
Count all distributed caches, which do not have ListSize or Limit. For example, N
Assign memory to all those caches, which have ListSize or Limit. For example, C
Remaining memory = B - C= D
Available memory for one cache = E = D/N
Capacity = E/ObjectSize.
- If the Limit is specified, the ListSize is ignored. Limit is the whole number and a percent. The minimum value is
1 and the maximum value is
99. However, a fraction is also supported with a single digit. The minium value is
0.1 and the maximum value is
99.9.
- Memory consumed by each cache = capacity * ObjectSize.
If the ListSize is specified as -1 and the Limit is not specified, this indicates the unlimited cache. Such caches are excluded from the memory computation and they have no limit.
If the object sizes are not correct, the actual memory allocation may be different from the total assigned memory allocation.
- Allocate 20% more than the actual memory.
- If the allocated heap size within the range tolerance of 5MB, a warning is displayed. However, if the tolerance exceeds, an error is displayed.
- If the distributed cache size exceeds the tolerance of 20MB, a warning is displayed. However, if the tolerance exceeds, an error is displayed.
To rectify the error that occurs when the allocated memory exceeds the specified memory, fix the allocation. If it does not resolve the error, specify the true value for Cache Memory Check property in Configurator. By default, the value is false.
- Specify the ratio between ProductKey to Record as 1: 3.3 and ProductKey to RecordMaxModVersion as 1:2.3.
- For large installations, it is recommended that RECORD, RECORDMAXMODVERSION, and PRODUCTKEY be set as unlimited.