Ehcache 2.10.8 | Product Documentation | Ehcache Configuration Guide | Sizing Storage Tiers | The Sizing Attributes
 
The Sizing Attributes
Tuning Ehcache often involves sizing the data storage tiers appropriately. You can size the different data tiers in a number of ways using simple sizing attributes. These sizing attributes affect memory and disk resources.
The following table summarizes the sizing attributes you can use.
Tier
Attribute
Description
Memory Store (Heap)
maxEntriesLocalHeapmax
BytesLocalHeap
The maximum number of entries or bytes a data set can use in local heap memory, or when set at the CacheManager level (maxBytesLocalHeap only), as a pool available to all data sets under that CacheManager. This setting is required for every cache or at the CacheManager level.
Pooling is available at the CacheManager level using maxBytesLocalHeap only.
Off-heap Store
maxBytesLocalOffHeap
The maximum number of bytes a data set can use in off-heap memory, or when set at the CacheManager level, as a pool available to all data sets under that CacheManager.
Pooling is available at the CacheManager level.
Disk Store
maxEntriesLocalDiskmax
BytesLocalDisk
The maximum number of entries or bytes a data set can use on the local disk, or when set at the CacheManager level (maxBytesLocalDisk only), as a pool available to all data sets under that CacheManager. Note that these settings apply to temporary disk usage (localTempSwap); these settings do not apply to disk persistence.
Pooling is available at the CacheManager level using maxBytesLocalDisk only.
Attributes that set a number of entries or elements take an integer. Attributes that set a memory size (bytes) use the Java -Xmx syntax (for example: "500k", "200m", "2g") or percentage (for example: "20%"). Percentages, however, can be used only in the case where a CacheManager-level pool has been configured.
The following diagram illustrates the tiers and their effective sizing attributes.

Copyright © 2010-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release