Class MemoryConfiguration
- java.lang.Object
- 
- org.apache.ignite.configuration.MemoryConfiguration
 
- 
- All Implemented Interfaces:
- Serializable
 
 @Deprecated public class MemoryConfiguration extends Object implements Serializable Deprecated.UseDataStorageConfigurationinstead.A page memory configuration for an Apache Ignite node. The page memory is a manageable off-heap based memory architecture that divides all expandable memory regions into pages of fixed size (seegetPageSize(). An individual page can store one or many cache key-value entries that allows reusing the memory in the most efficient way and avoid memory fragmentation issues.By default, the page memory allocates a single expandable memory region using settings of createDefaultPolicyConfig(). All the caches that will be configured in an application will be mapped to this memory region by default, thus, all the cache data will reside in that memory region.If initial size of the default memory region doesn't satisfy requirements or it's required to have multiple memory regions with different properties then MemoryPolicyConfigurationcan be used for both scenarios. For instance, using memory policies you can define memory regions of different maximum size, eviction policies, swapping options, etc. Once you define a new memory region you can bind particular Ignite caches to it.To learn more about memory policies refer to MemoryPolicyConfigurationdocumentation.Sample configuration below shows how to make 5 GB memory regions the default one for Apache Ignite: <property name="memoryConfiguration"> <bean class="org.apache.ignite.configuration.MemoryConfiguration"> <property name="systemCacheInitialSize" value="#{100L * 1024 * 1024}"/> <property name="defaultMemoryPolicyName" value="default_mem_plc"/> <property name="memoryPolicies"> <list> <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration"> <property name="name" value="default_mem_plc"/> <property name="initialSize" value="#{5L * 1024 * 1024 * 1024}"/> </bean> </list> </property> </bean> </property>- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringDFLT_MEM_PLC_DEFAULT_NAMEDeprecated.This name is assigned to default DataRegion if no user-defined default MemPlc is specifiedstatic longDFLT_MEMORY_POLICY_INITIAL_SIZEDeprecated.Default memory policy start size (256 MB).static longDFLT_MEMORY_POLICY_MAX_SIZEDeprecated.Default memory policy's size is 20% of physical memory available on current machine.static intDFLT_PAGE_SIZEDeprecated.Default memory page size.
 - 
Constructor SummaryConstructors Constructor Description MemoryConfiguration()Deprecated.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MemoryPolicyConfigurationcreateDefaultPolicyConfig()Deprecated.Creates a configuration for the default memory policy that will instantiate the default memory region.intgetConcurrencyLevel()Deprecated.Returns the number of concurrent segments in Ignite internal page mapping tables.StringgetDefaultMemoryPolicyName()Deprecated.Gets a name of default memory policy.longgetDefaultMemoryPolicySize()Deprecated.Gets a size for default memory policy overridden by user.MemoryPolicyConfiguration[]getMemoryPolicies()Deprecated.Gets an array of all memory policies configured.intgetPageSize()Deprecated.The pages memory consists of one or more expandable memory regions defined byMemoryPolicyConfiguration.longgetSystemCacheInitialSize()Deprecated.Initial size of a memory region reserved for system cache.longgetSystemCacheMaxSize()Deprecated.Maximum memory region size reserved for system cache.MemoryConfigurationsetConcurrencyLevel(int concLvl)Deprecated.Sets the number of concurrent segments in Ignite internal page mapping tables.MemoryConfigurationsetDefaultMemoryPolicyName(String dfltMemPlcName)Deprecated.Sets the name for the default memory policy that will initialize the default memory region.MemoryConfigurationsetDefaultMemoryPolicySize(long dfltMemPlcSize)Deprecated.Overrides size of default memory policy which is created automatically.MemoryConfigurationsetMemoryPolicies(MemoryPolicyConfiguration... memPlcs)Deprecated.Sets memory policies configurations.MemoryConfigurationsetPageSize(int pageSize)Deprecated.Changes the page size.MemoryConfigurationsetSystemCacheInitialSize(long sysCacheInitSize)Deprecated.Sets initial size of a memory region reserved for system cache.MemoryConfigurationsetSystemCacheMaxSize(long sysCacheMaxSize)Deprecated.Sets maximum memory region size reserved for system cache.StringtoString()Deprecated.
 
- 
- 
- 
Field Detail- 
DFLT_MEMORY_POLICY_INITIAL_SIZEpublic static final long DFLT_MEMORY_POLICY_INITIAL_SIZE Deprecated.Default memory policy start size (256 MB).- See Also:
- Constant Field Values
 
 - 
DFLT_MEMORY_POLICY_MAX_SIZEpublic static final long DFLT_MEMORY_POLICY_MAX_SIZE Deprecated.Default memory policy's size is 20% of physical memory available on current machine.
 - 
DFLT_PAGE_SIZEpublic static final int DFLT_PAGE_SIZE Deprecated.Default memory page size.- See Also:
- Constant Field Values
 
 - 
DFLT_MEM_PLC_DEFAULT_NAMEpublic static final String DFLT_MEM_PLC_DEFAULT_NAME Deprecated.This name is assigned to default DataRegion if no user-defined default MemPlc is specified- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getSystemCacheInitialSizepublic long getSystemCacheInitialSize() Deprecated.Initial size of a memory region reserved for system cache.- Returns:
- Size in bytes.
 
 - 
setSystemCacheInitialSizepublic MemoryConfiguration setSystemCacheInitialSize(long sysCacheInitSize) Deprecated.Sets initial size of a memory region reserved for system cache. Default value isDFLT_SYS_CACHE_INIT_SIZE- Parameters:
- sysCacheInitSize- Size in bytes.
- Returns:
- thisfor chaining.
 
 - 
getSystemCacheMaxSizepublic long getSystemCacheMaxSize() Deprecated.Maximum memory region size reserved for system cache.- Returns:
- Size in bytes.
 
 - 
setSystemCacheMaxSizepublic MemoryConfiguration setSystemCacheMaxSize(long sysCacheMaxSize) Deprecated.Sets maximum memory region size reserved for system cache. The total size should not be less than 10 MB due to internal data structures overhead.- Parameters:
- sysCacheMaxSize- Maximum size in bytes for system cache memory region.
- Returns:
- thisfor chaining.
 
 - 
getPageSizepublic int getPageSize() Deprecated.The pages memory consists of one or more expandable memory regions defined byMemoryPolicyConfiguration. Every memory region is split on pages of fixed size that store actual cache entries.- Returns:
- Page size in bytes.
 
 - 
setPageSizepublic MemoryConfiguration setPageSize(int pageSize) Deprecated.Changes the page size. Default value isDFLT_PAGE_SIZE- Parameters:
- pageSize- Page size in bytes.
- Returns:
- thisfor chaining.
 
 - 
getMemoryPoliciespublic MemoryPolicyConfiguration[] getMemoryPolicies() Deprecated.Gets an array of all memory policies configured. Apache Ignite will instantiate a dedicated memory region per policy. An Apache Ignite cache can be mapped to a specific policy withCacheConfiguration.setMemoryPolicyName(String)method.- Returns:
- Array of configured memory policies.
 
 - 
setMemoryPoliciespublic MemoryConfiguration setMemoryPolicies(MemoryPolicyConfiguration... memPlcs) Deprecated.Sets memory policies configurations.- Parameters:
- memPlcs- Memory policies configurations.
- Returns:
- thisfor chaining.
 
 - 
createDefaultPolicyConfigpublic MemoryPolicyConfiguration createDefaultPolicyConfig() Deprecated.Creates a configuration for the default memory policy that will instantiate the default memory region. To override settings of the default memory policy in order to create the default memory region with different parameters, create own memory policy first, pass it tosetMemoryPolicies(MemoryPolicyConfiguration...)method and change the name of the default memory policy withsetDefaultMemoryPolicyName(String).- Returns:
- default Memory policy configuration.
 
 - 
getConcurrencyLevelpublic int getConcurrencyLevel() Deprecated.Returns the number of concurrent segments in Ignite internal page mapping tables. By default equals to the number of available CPUs multiplied by 4.- Returns:
- Mapping table concurrency level.
 
 - 
setConcurrencyLevelpublic MemoryConfiguration setConcurrencyLevel(int concLvl) Deprecated.Sets the number of concurrent segments in Ignite internal page mapping tables.- Parameters:
- concLvl- Mapping table concurrency level.
- Returns:
- thisfor chaining.
 
 - 
getDefaultMemoryPolicySizepublic long getDefaultMemoryPolicySize() Deprecated.Gets a size for default memory policy overridden by user.- Returns:
- Default memory policy size overridden by user or DFLT_MEMORY_POLICY_MAX_SIZEif nothing was specified.
 
 - 
setDefaultMemoryPolicySizepublic MemoryConfiguration setDefaultMemoryPolicySize(long dfltMemPlcSize) Deprecated.Overrides size of default memory policy which is created automatically. If user doesn't specify any memory policy configuration, a default one with default size (20% of available RAM) is created by Ignite. This property allows user to specify desired size of default memory policy without having to use more verbose syntax of MemoryPolicyConfiguration elements.- Parameters:
- dfltMemPlcSize- Size of default memory policy overridden by user.
- Returns:
- thisfor chaining.
 
 - 
getDefaultMemoryPolicyNamepublic String getDefaultMemoryPolicyName() Deprecated.Gets a name of default memory policy.- Returns:
- A name of a custom memory policy configured with MemoryConfigurationornullof the default policy is used.
 
 - 
setDefaultMemoryPolicyNamepublic MemoryConfiguration setDefaultMemoryPolicyName(String dfltMemPlcName) Deprecated.Sets the name for the default memory policy that will initialize the default memory region. To set own default memory policy, create the policy first, pass it tosetMemoryPolicies(MemoryPolicyConfiguration...)method and change the name of the default memory policy withMemoryConfiguration#setDefaultMemoryPolicyName(String). If nothing is specified by user, it is set toDFLT_MEM_PLC_DEFAULT_NAMEvalue.- Parameters:
- dfltMemPlcName- Name of a memory policy to be used as default one.
- Returns:
- thisfor chaining.
 
 
- 
 
-